fix gh actions #13
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: Cross-Platform Compile and Publish | ||
| description: Compiles on multiple platforms and publishes to deken if merging to main | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - "main" | ||
| paths: | ||
| - "include/**" | ||
| - "src/**" | ||
| - "Makefile" | ||
| - "config.sh" | ||
| tags: | ||
| - 'v*' | ||
| pull_request: | ||
| paths: | ||
| - "include/**" | ||
| - "src/**" | ||
| - "Makefile" | ||
| - "config.sh" | ||
| jobs: | ||
| build: | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| runs-on: ${{ matrix.os }} | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| env: | ||
| PDVERSION: pd-0.56-2 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: setup deken | ||
| uses: ./.github/actions/setup-deken | ||
| # ---- platform-specific setup ---- | ||
| - name: setup pd (unix) | ||
| if: matrix.os != 'windows-latest' | ||
| uses: ./.github/actions/setup-pd | ||
| - name: install mac deps | ||
| if: matrix.os == 'macos-latest' | ||
| run: brew install automake autoconf libtool | ||
| - name: setup windows deps | ||
| if: matrix.os == 'windows-latest' | ||
| run: | | ||
| echo "local_short_commands=true" >> $GITHUB_ENV | ||
| git submodule init && git submodule update | ||
| curl -O "http://msp.ucsd.edu/Software/$PDVERSION.msw.zip" | ||
| unzip "$PDVERSION.msw.zip" | ||
| # ---- build ---- | ||
| - name: configure | ||
| run: bash config.sh | ||
| - name: make (unix) | ||
| if: matrix.os != 'windows-latest' | ||
| run: make PDINCLUDEDIR=pure-data/src | ||
| - name: make (windows) | ||
| if: matrix.os == 'windows-latest' | ||
| run: make pdbinpath="$PDVERSION/bin" PDINCLUDEDIR="$PDVERSION/src" CFLAGS=-march=x86-64 | ||
| # ---- package ---- | ||
| - name: package library | ||
| run: | | ||
| bash scripts/package_lib.sh | ||
| ls -la | ||
| mkdir -p "${{ matrix.os }}" | ||
| cp -r fd_lib "${{ matrix.os }}/" | ||
| - name: create deken packages | ||
| run: | | ||
| mkdir -p build | ||
| for dir in fd_lib-*; do | ||
| ./deken package --output-dir ./build --no-sign-gpg --name fd_lib --version "${{ github.ref_name }}" "$dir" | ||
| done | ||
| - name: upload artifact | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: "fd_lib-${{ github.ref_name }}-build" | ||
| path: ./build | ||
| if-no-files-found: error | ||
| compression-level: 0 | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| needs: build | ||
| if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' | ||
| steps: | ||
| - name: setup deken | ||
| uses: ./.github/actions/setup-deken | ||
| - name: download all artifacts | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| skip-decompress: true | ||
| - name: upload all to deken | ||
| env: | ||
| deken_username: ${{ secrets.DEKEN_USERNAME }} | ||
| deken_password: ${{ secrets.DEKEN_PASSWORD }} | ||
| run: ./deken upload **/*.dek | ||