v0.0.7 #16
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 and release | |
| on: | |
| release: | |
| types: [created] | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| binary_name: dm_reverse | |
| plugin_name: dm-Reverse | |
| mod_package_name: dm-reverse | |
| jobs: | |
| package-mod-plugin: | |
| name: Package mod plugins | |
| strategy: | |
| matrix: | |
| platform: [modduo-new, modduox-new, moddwarf-new] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Pull Docker image from GHCR | |
| run: docker pull ghcr.io/davemollen/${{ matrix.platform }}-plugin-builder:latest | |
| - name: Run Docker container | |
| run: docker run -t -d --name mpb ghcr.io/davemollen/${{ matrix.platform }}-plugin-builder:latest | |
| - name: Update commit sha in build script | |
| run: sed -i 's/<SHA>/${{ github.sha }}/' .github/workflows/$mod_package_name.mk | |
| - name: Add local build script to Docker container | |
| run: | | |
| docker exec -w /root/mod-plugin-builder/plugins/package mpb mkdir -p $mod_package_name | |
| docker cp .github/workflows/$mod_package_name.mk mpb:/root/mod-plugin-builder/plugins/package/$mod_package_name | |
| - name: Build for modaudio | |
| run: docker exec mpb ./build ${{ matrix.platform }} $mod_package_name | |
| - name: Determine build archive name | |
| run: echo "ARCHIVE_NAME=$plugin_name-${{ matrix.platform }}" >> "$GITHUB_ENV" | |
| - name: Zip files | |
| run: | | |
| mkdir -p $ARCHIVE_NAME | |
| docker cp mpb:/root/mod-workdir/${{ matrix.platform }}/plugins/$plugin_name.lv2 $ARCHIVE_NAME | |
| cp .github/workflows/readme-Mod.txt "$ARCHIVE_NAME/README.txt" | |
| zip -r $ARCHIVE_NAME.zip $ARCHIVE_NAME | |
| - name: Add zip to release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{github.ref_name}} | |
| files: ${{ env.ARCHIVE_NAME }}.zip | |
| package-mod-desktop-plugin: | |
| name: Package mod desktop plugins | |
| strategy: | |
| matrix: | |
| include: | |
| - { name: ubuntu, os: ubuntu-latest, cross-target: "" } | |
| - { name: macos, os: macos-latest, cross-target: x86_64-apple-darwin } | |
| - { name: windows, os: windows-latest, cross-target: "" } | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Rust toolchain | |
| # Needed for SIMD | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| # The macOS x86_64 build is done from an AArch64 macOS CI runner, so | |
| # it needs to be cross compiled | |
| targets: ${{ matrix.cross-target }} | |
| - name: Build lv2 plugin | |
| working-directory: ./lv2 | |
| run: | | |
| runner_name=${{ matrix.name }} | |
| if [[ $runner_name = 'macos' ]]; then | |
| MACOSX_DEPLOYMENT_TARGET=10.15 cargo build --release --target x86_64-apple-darwin | |
| MACOSX_DEPLOYMENT_TARGET=10.15 cargo build --release --target aarch64-apple-darwin | |
| lipo -create target/x86_64-apple-darwin/release/lib$binary_name.dylib target/aarch64-apple-darwin/release/lib$binary_name.dylib -output target/release/lib$binary_name.dylib | |
| file target/release/lib$binary_name.dylib | |
| perl -pi -e "s|lib$binary_name.so|lib$binary_name.dylib|" $plugin_name.lv2/manifest.ttl | |
| mv target/release/lib$binary_name.dylib $plugin_name.lv2 | |
| elif [[ $runner_name = 'windows' ]]; then | |
| cargo build --release | |
| perl -pi -e "s|lib$binary_name.so|$binary_name.dll|" $plugin_name.lv2/manifest.ttl | |
| mv target/release/$binary_name.dll $plugin_name.lv2 | |
| else | |
| cargo build --release | |
| mv target/release/lib$binary_name.so $plugin_name.lv2 | |
| fi | |
| - name: Determine build archive name | |
| run: | | |
| # Windows (usually) doesn't like colons in file names | |
| echo "ARCHIVE_NAME=$plugin_name-${{ matrix.name }}" >> "$GITHUB_ENV" | |
| - name: Move all packaged plugin into a directory | |
| run: | | |
| mkdir -p $ARCHIVE_NAME | |
| mv ./lv2/$plugin_name.lv2 $ARCHIVE_NAME | |
| - name: Add an OS-specific readme file with installation instructions | |
| run: cp ".github/workflows/readme-ModDesktop.txt" "$ARCHIVE_NAME/README.txt" | |
| - name: Zip files | |
| if: startsWith(matrix.os, 'windows') | |
| shell: pwsh | |
| run: | | |
| $archiveName = "$env:ARCHIVE_NAME" | |
| Compress-Archive -Path $archiveName -DestinationPath "$archiveName.zip" | |
| - name: Zip files | |
| if: startsWith(matrix.os, 'windows') != true | |
| run: zip -r $ARCHIVE_NAME.zip $ARCHIVE_NAME | |
| - name: Add zip to release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{github.ref_name}} | |
| files: ${{ env.ARCHIVE_NAME }}.zip |