Skip to content

Merge pull request #47 from ben-wes/build-tests #177

Merge pull request #47 from ben-wes/build-tests

Merge pull request #47 from ben-wes/build-tests #177

Workflow file for this run

name: Makefile CI
on:
push:
branches: [ master, build-tests ]
tags: [ '*' ]
pull_request:
branches: [ master ]
jobs:
ubuntu-build:
runs-on: ubuntu-latest
strategy:
matrix:
floatsize: [32, 64]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: install dependencies
run: sudo apt install puredata-dev
- name: make
run: make install objectsdir=./build floatsize=${{ matrix.floatsize }} extension=linux-amd64-${{ matrix.floatsize }}.so
- name: upload
uses: actions/upload-artifact@v4
with:
name: pdlua-ubuntu-pd${{ matrix.floatsize }}
path: build
macos-build:
runs-on: macos-latest
strategy:
matrix:
floatsize: [32, 64]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: install dependencies
run: |
wget https://github.com/pure-data/pure-data/archive/refs/tags/0.55-0.zip
unzip 0.55-0.zip
- name: make
run: make install objectsdir=./build PDDIR=./pure-data-0.55-0 arch="arm64 x86_64" floatsize=${{ matrix.floatsize }} extension=darwin-fat-${{ matrix.floatsize }}.so
- name: upload
uses: actions/upload-artifact@v4
with:
name: pdlua-macos-pd${{ matrix.floatsize }}
path: build
windows-build:
runs-on: windows-2019
strategy:
matrix:
floatsize: [32, 64]
env:
CC: gcc
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: install dependencies for 32-bit
if: matrix.floatsize == 32
run: |
C:\msys64\usr\bin\wget.exe http://msp.ucsd.edu/Software/pd-0.55-0.msw.zip
unzip pd-0.55-0.msw.zip
- name: install dependencies for 64-bit
if: matrix.floatsize == 64
run: | # unfortunately, the folder name convention is slightly different here
C:\msys64\usr\bin\wget.exe https://puredata.info/downloads/pure-data/releases/0.55-0-pd64/Pd64-0.55-0.msw.zip
unzip Pd64-0.55-0.msw.zip
ren Pd-0.55.0 pd-0.55-0
- name: make 32-bit
run: make install objectsdir=./build PDDIR=./pd-0.55-0 PDINCLUDEDIR=./pd-0.55-0/src PDBINDIR=./pd-0.55-0/bin floatsize=${{ matrix.floatsize }} extension=windows-amd64-${{ matrix.floatsize }}.dll
- name: upload
uses: actions/upload-artifact@v4
with:
name: pdlua-windows-pd${{ matrix.floatsize }}
path: build
# Big thanks to @tomara-x and @timothyschoen for showing me how to do this! -ag
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [ubuntu-build, macos-build, windows-build]
steps:
- uses: actions/download-artifact@v4
- name: ziptie
run: |
mkdir dist
for x in pdlua-*; do (cd $x && zip -r ../dist/$x.zip pdlua/); done
- name: release
uses: softprops/action-gh-release@v2
with:
prerelease: true
draft: true
files: dist/*.zip
merge:
runs-on: ubuntu-latest
needs: [ubuntu-build, macos-build, windows-build]
permissions:
contents: write
actions: read
strategy:
matrix:
os: [windows, macos, ubuntu]
steps:
- name: Download Artifacts # FIXME: currently downloads all artifacts redundantly for each OS
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Merge Artifacts to Package
run: cp -rn artifacts/pdlua-${{ matrix.os }}*/* .
- name: Upload Package
uses: actions/upload-artifact@v4
with:
name: pdlua-${{ matrix.os }}
path: pdlua
deken_check_and_upload:
runs-on: ubuntu-latest
needs: [merge]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
with:
path: pdlua-src
- uses: actions/download-artifact@v4
with:
name: pdlua-windows
path: pdlua-windows
- uses: actions/download-artifact@v4
with:
name: pdlua-macos
path: pdlua-macos
- uses: actions/download-artifact@v4
with:
name: pdlua-ubuntu
path: pdlua-ubuntu
- name: Check Deken Package
shell: bash
run: |
SHORT=${GITHUB_REF:10}
VERSION=${SHORT//\//_}
for os in ubuntu macos windows; do
echo "## ${os}" | tee -a $GITHUB_STEP_SUMMARY
mkdir -p package-${os}
docker run --rm --user $(id -u) --volume ./pdlua-${os}:/pdlua \
--volume ./package-${os}:/package registry.git.iem.at/pd/deken \
deken package --output-dir /package -v "${VERSION}" /pdlua
dek_files=$(ls package-${os}/*.dek)
for dek_file in $dek_files; do
filename=$(basename "$dek_file")
echo -e "#### \`$filename\`" | tee -a $GITHUB_STEP_SUMMARY
echo '```' | tee -a $GITHUB_STEP_SUMMARY
unzip -l "$dek_file" | awk 'NR>3 {print $4}' | sed '/^$/d' | sort | tee -a $GITHUB_STEP_SUMMARY
echo '```' | tee -a $GITHUB_STEP_SUMMARY
done
done
- name: Upload Deken Package
if: ${{ !contains(github.ref, 'test') }} # upload if not a "test" release
shell: bash
env:
DEKEN_USERNAME: ${{ secrets.DEKEN_USERNAME }}
DEKEN_PASSWORD: ${{ secrets.DEKEN_PASSWORD }}
run: |
SHORT=${GITHUB_REF:10}
VERSION=${SHORT//\//_}
for os in ubuntu macos windows; do
docker run --rm -e DEKEN_USERNAME -e DEKEN_PASSWORD \
--volume ./pdlua-${os}:/pdlua registry.git.iem.at/pd/deken \
deken upload --no-source-error -v "${VERSION}" /pdlua
done
docker run --rm -e DEKEN_USERNAME -e DEKEN_PASSWORD \
--volume ./pdlua-src:/pdlua registry.git.iem.at/pd/deken \
deken upload -v "${VERSION}" /pdlua