build pd-lib-builder based pure data externals #61
Workflow file for this run
This file contains hidden or 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 pd-lib-builder based pure data externals | |
| on: | |
| workflow_call: | |
| workflow_dispatch: | |
| inputs: | |
| core_run_id: | |
| description: "Run ID of a successful 'build zerr-core static library' workflow (needed when not triggered via workflow_run)" | |
| required: false | |
| type: string | |
| # push: | |
| # branches: | |
| # - main | |
| # paths: | |
| # - 'puredata/**' # Trigger when Pure Data related code changes | |
| workflow_run: | |
| workflows: ["build zerr-core static library"] | |
| types: | |
| - completed | |
| jobs: | |
| macOS: | |
| runs-on: macos-latest | |
| env: | |
| cflags: -mmacosx-version-min=10.9 | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Ensure core artifact id present | |
| env: | |
| CORE_RUN_ID: ${{ github.event.workflow_run.id || inputs.core_run_id }} | |
| run: | | |
| if [ -z "${CORE_RUN_ID}" ]; then | |
| echo "CORE_RUN_ID missing. Provide inputs.core_run_id when dispatching manually or trigger via workflow_run." >&2 | |
| exit 1 | |
| fi | |
| - name: Download zerr-core library | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: zerr-core-macos | |
| path: core/lib/ | |
| run-id: ${{ github.event.workflow_run.id || inputs.core_run_id }} | |
| github-token: ${{ github.token }} | |
| - name: Display structure of downloaded files | |
| run: ls -R core/lib/ | |
| - name: Install Pure Data | |
| run: brew install --cask pd | |
| - name: Set up Conan | |
| run: | | |
| pip install conan | |
| conan profile detect | |
| - name: Configure Conan | |
| working-directory: puredata | |
| run: | | |
| conan install . --output-folder=build --build=missing | |
| - name: Build & Install | |
| working-directory: puredata | |
| run: | | |
| make | |
| make install PDLIBDIR=build | |
| - name: Upload macOS artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zerr-pd-macos | |
| path: puredata/build/zerr | |
| linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Ensure core artifact id present | |
| env: | |
| CORE_RUN_ID: ${{ github.event.workflow_run.id || inputs.core_run_id }} | |
| run: | | |
| if [ -z "${CORE_RUN_ID}" ]; then | |
| echo "CORE_RUN_ID missing. Provide inputs.core_run_id when dispatching manually or trigger via workflow_run." >&2 | |
| exit 1 | |
| fi | |
| - name: Download zerr-core library | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: zerr-core-linux | |
| path: core/lib/ | |
| run-id: ${{ github.event.workflow_run.id || inputs.core_run_id }} | |
| github-token: ${{ github.token }} | |
| - name: Display structure of downloaded files | |
| run: ls -R core/lib/ | |
| - name: Install Pure Data | |
| run: sudo apt update && sudo apt install puredata-dev | |
| - name: Set up Conan | |
| run: | | |
| pip install conan | |
| conan profile detect | |
| - name: Configure Conan | |
| working-directory: puredata | |
| run: | | |
| conan install . --output-folder=build --build=missing | |
| - name: Build & Install | |
| working-directory: puredata | |
| run: | | |
| make | |
| make install PDLIBDIR=build | |
| - name: Upload Linux artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zerr-pd-linux | |
| path: puredata/build/zerr | |
| windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Ensure core artifact id present | |
| shell: bash | |
| env: | |
| CORE_RUN_ID: ${{ github.event.workflow_run.id || inputs.core_run_id }} | |
| run: | | |
| if [ -z "${CORE_RUN_ID}" ]; then | |
| echo "CORE_RUN_ID missing. Provide inputs.core_run_id when dispatching manually or trigger via workflow_run." >&2 | |
| exit 1 | |
| fi | |
| - name: Set up MinGW | |
| uses: egor-tensin/setup-mingw@v3 | |
| with: | |
| arch: x64 | |
| - name: Install Pd | |
| shell: pwsh | |
| run: | | |
| wget -q -O Pd.zip http://msp.ucsd.edu/Software/pd-0.53-2.msw.zip | |
| rm -rf "${PROGRAMFILES}/pd" && mkdir -p "${PROGRAMFILES}/pd" | |
| unzip -q Pd.zip -d "${PROGRAMFILES}/pd" | |
| mv -v "${PROGRAMFILES}/pd"/*/* "${PROGRAMFILES}/pd" | |
| rm -f Pd.zip | |
| export PD="${PROGRAMFILES}/pd/bin/pd.com" | |
| echo "PD=${PD}" | tee "$GITHUB_OUTPUT" | |
| - name: Download zerr-core library | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: zerr-core-windows | |
| path: core/lib/ | |
| run-id: ${{ github.event.workflow_run.id || inputs.core_run_id }} | |
| github-token: ${{ github.token }} | |
| - name: Set up Conan | |
| run: | | |
| pip install conan | |
| conan profile detect --name=mingw --force | |
| conan profile update settings.compiler=gcc mingw | |
| conan profile update settings.compiler.version=13 mingw | |
| conan profile update settings.compiler.libcxx=libstdc++11 mingw | |
| conan profile update settings.os=Windows mingw | |
| conan profile update settings.arch=x86_64 mingw | |
| conan profile update settings.build_type=Release mingw | |
| - name: Install Dependencies | |
| working-directory: puredata | |
| run: | | |
| mkdir -p build | |
| conan install . --output-folder=build --build=missing -pr:b=mingw -pr:h=mingw | |
| - name: Build External | |
| shell: bash | |
| working-directory: puredata | |
| run: | | |
| mingw32-make | |
| mingw32-make install PDLIBDIR=build | |
| - name: Upload Windows artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zerr-pd-windows | |
| path: puredata/build/zerr |