help (temporarily) completed, workflow extended #105
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and upload artifacts | |
on: [push, pull_request] | |
env: | |
PD_VERSION: 0.54-1 | |
PDINCLUDEDIR: ./pure-data/src | |
PDLIBDIR: ./build | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [amd64, arm64] | |
precision: [32, 64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Clone Pd | |
run: git clone --branch=${{ env.PD_VERSION }} --depth=1 https://github.com/pure-data/pure-data.git | |
- name: Compile external | |
run: make install floatsize=${{ matrix.precision }} extension=linux-${{ matrix.arch }}-${{ matrix.precision }}.so | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: simplex~-linux-${{ matrix.arch }}-pd${{ matrix.precision }} | |
path: build/simplex~ | |
build-macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
arch: [amd64, arm64] | |
precision: [32, 64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Clone Pd | |
run: git clone --branch=${{ env.PD_VERSION }} --depth=1 https://github.com/pure-data/pure-data.git | |
- name: Set up environment | |
run: brew install make | |
- name: Compile external | |
run: make install floatsize=${{ matrix.precision }} extension=darwin-${{ matrix.arch }}-${{ matrix.precision }}.so | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: simplex~-macos-${{ matrix.arch }}-pd${{ matrix.precision }} | |
path: build/simplex~ | |
build-windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
arch: [amd64, i386] | |
precision: [32] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Download Pure-Data Binaries | |
run: | | |
Invoke-WebRequest -Uri "http://msp.ucsd.edu/Software/pd-${{env.PD_VERSION}}.msw.zip" -OutFile "pd-${{env.PD_VERSION}}.msw.zip" | |
Expand-Archive -Path "pd-${{env.PD_VERSION}}.msw.zip" -DestinationPath . | |
- name: Set up compiler environment | |
run: | | |
echo "C:\\msys64\\usr\\bin" >> $GITHUB_PATH # Ensure make and GCC are in PATH | |
- name: Compile external | |
shell: bash | |
run: | | |
export PATH="/c/msys64/mingw64/bin:$PATH" # Ensure MinGW GCC is preferred if needed | |
make install CC=gcc PDINCLUDEDIR="pd-${{env.PD_VERSION}}/src" PDDIR="pd-${{env.PD_VERSION}}" PDBINDIR="pd-${{env.PD_VERSION}}/bin" extension=windows-${{ matrix.arch }}-32.dll | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: simplex~-windows-${{ matrix.arch }}-pd${{ matrix.precision }} | |
path: build/simplex~ | |
download-artifacts: | |
runs-on: ubuntu-latest | |
needs: [ build-linux, build-macos, build-windows ] | |
strategy: | |
matrix: | |
os: [linux, macos, windows] | |
arch: [amd64, arm64, i386] | |
precision: [32, 64] | |
exclude: | |
- { os: windows, precision: 64 } | |
- { os: windows, arch: arm64 } | |
- { os: linux, arch: i386 } | |
- { os: macos, arch: i386 } | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: simplex~-${{ matrix.os }}-${{ matrix.arch }}-pd${{ matrix.precision }} | |
path: artifacts/${{ matrix.os }} | |
package-release: | |
needs: download-artifacts | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
actions: read | |
steps: | |
- name: Setup directories | |
run: | | |
mkdir -p simplex~ | |
mkdir -p artifacts/linux | |
mkdir -p artifacts/macos | |
mkdir -p artifacts/windows | |
- name: Download All Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts/ | |
- name: Merge Artifacts | |
run: | | |
cp -rn artifacts/*/* simplex~/ | |
- name: Rezip | |
run: | | |
SHORT=${GITHUB_REF:11} # Removes 'refs/tags/' prefix | |
SLUG=${SHORT//\//_} # Replaces '/' with '_' | |
zip -r simplex~-${SLUG}.zip simplex~ | |
- name: Upload release content as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: simplex~ | |
path: simplex~ | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: simplex*.zip | |
upload_to_deken: | |
runs-on: ubuntu-latest | |
needs: [package-release] | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: simplex-src | |
- uses: actions/download-artifact@v4 | |
with: | |
name: simplex~ | |
path: simplex | |
- name: Create Deken Package | |
shell: bash | |
env: | |
DEKEN_USERNAME: ${{ secrets.DEKEN_USERNAME }} | |
DEKEN_PASSWORD: ${{ secrets.DEKEN_PASSWORD }} | |
run: | | |
SHORT=${GITHUB_REF:11} # remove the 'refs/tags/' prefix | |
SLUG=${SHORT//\//_} # replace '/' with '_' | |
if [[ "${GITHUB_REF}" == *"test"* ]]; then | |
echo "dry-run: preparing to upload for test tag ${GITHUB_REF}" | |
docker run --rm --volume ${PWD}/simplex-src:/simplex~ registry.git.iem.at/pd/deken deken package -v "${SLUG}" /simplex~ | |
ls -d simplex* | |
docker run --rm --volume ${PWD}/simplex:/simplex~ registry.git.iem.at/pd/deken deken --no-source-error package -v "${SLUG}" /simplex~ | |
ls -d simplex* | |
fi | |
# else | |
# docker run --rm -e DEKEN_USERNAME -e DEKEN_PASSWORD --volume ${PWD}/simplex-src:/simplex~ registry.git.iem.at/pd/deken deken upload -v "${SLUG}" /simplex~ | |
# docker run --rm -e DEKEN_USERNAME -e DEKEN_PASSWORD --volume ${PWD}/simplex:/simplex~ registry.git.iem.at/pd/deken deken upload --no-source-error -v "${SLUG}" /simplex~ | |
# fi |