name: CI on: push: pull_request: workflow_dispatch: inputs: is_notarized: description: 'Whether to notarize the MacOS build' required: false type: boolean default: true build_type: description: 'Build type' required: false type: choice options: - Release - Debug default: Release schedule: - cron: '0 21 * * 0' env: # Build type: uses input if workflow_dispatch, otherwise checks for '[debug]' in commit message build_type: ${{ inputs.build_type || (contains(github.event.head_commit.message, '[debug]') && 'Debug' || 'Release') }} # Checks whether to create a release: checks if event is a tag is_release: ${{ startsWith(github.ref, 'refs/tags/') }} # Checks whether to notarize the MacOS build: uses input if workflow_dispatch, otherwise checks if the workflow is triggered by a pull request from a forked repository is_notarized: ${{ (github.event_name == 'workflow_dispatch' && inputs.is_notarized) || (github.event_name != 'workflow_dispatch' && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork)) }} jobs: # Checks source code formatting with clang before compiling. Format: runs-on: ubuntu-latest strategy: matrix: path: - 'Source' - 'VampPlugins' - 'Dependencies/Misc/Source' steps: - uses: actions/checkout@v7 - name: Check uses: jidicula/clang-format-action@v4.18.0 with: clang-format-version: '20' check-path: ${{ matrix.path }} # Compiles, tests and packages the plugin for Ubuntu. Ubuntu: runs-on: ubuntu-22.04 needs: Format steps: - uses: actions/checkout@v7 with: submodules: recursive - uses: mozilla-actions/sccache-action@v0.0.10 - uses: seanmiddleditch/gha-setup-ninja@master - run: sudo apt install imagemagick - name: Prepare run: sudo apt update && sudo apt install build-essential libasound2-dev libjack-jackd2-dev ladspa-sdk libfreetype-dev libfontconfig1-dev libx11-dev libxcomposite-dev libxcursor-dev libxext-dev libxinerama-dev libxrandr-dev libxrender-dev libglu1-mesa-dev mesa-common-dev - name: Configure run: cmake -B ${{ github.workspace }}/build -G Ninja -DCMAKE_BUILD_TYPE=${{ env.build_type }} -DCMAKE_C_COMPILER="/usr/bin/clang" -DCMAKE_CXX_COMPILER="/usr/bin/clang++" -DPARTIELS_BUILD_TAG=${{ env.version_name }} - name: Build run: cmake --build ${{ github.workspace }}/build - name: Test run: ctest -C ${{ env.build_type }} -VV --test-dir ${{ github.workspace }}/build --output-on-failure - name: Artifact uses: actions/upload-artifact@v7.0.1 with: name: Partiels-Linux path: ${{ github.workspace }}/build/Partiels-Linux.tar.gz - name: Release uses: softprops/action-gh-release@v3 if: ${{ env.is_release == 'true' }} with: draft: true prerelease: true fail_on_unmatched_files: true generate_release_notes: true body_path: ${{ github.workspace }}/build/Partiels-Release.md files: ${{ github.workspace }}/build/Partiels-Linux.tar.gz # Compiles, tests and packages the plugin for Windows. Windows: runs-on: windows-2022 needs: Format steps: - uses: actions/checkout@v7 with: submodules: recursive - uses: mozilla-actions/sccache-action@v0.0.10 - run: choco install imagemagick -fy -d - run: choco install innosetup -fy -d - name: Configure run: cmake -B ${{ github.workspace }}/build -G "Visual Studio 17 2022" -A x64 -DPARTIELS_BUILD_TAG="${{ env.version_name }}" -DImageMagick_DIR=PATH:"C:/Program Files/ImageMagick-7.1.1-Q16-HDRI" - name: Build run: cmake --build ${{ github.workspace }}/build --config ${{ env.build_type }} - name: Test run: ctest -C ${{ env.build_type }} -VV --test-dir ${{ github.workspace }}/build --output-on-failure - name: Artifact uses: actions/upload-artifact@v7.0.1 with: name: Partiels-Windows path: ${{ github.workspace }}/build/Partiels-Windows.exe - name: Release uses: softprops/action-gh-release@v3 if: ${{ env.is_release == 'true' }} with: draft: true prerelease: true fail_on_unmatched_files: true generate_release_notes: true body_path: ${{ github.workspace }}/build/Partiels-Release.md files: ${{ github.workspace }}/build/Partiels-Windows.exe # Compiles, tests and packages the plugin for MacOS. MacOS: runs-on: macos-latest needs: Format steps: - name: Checkout uses: actions/checkout@v7 with: submodules: recursive - uses: mozilla-actions/sccache-action@v0.0.10 - uses: actions/setup-node@v7 with: node-version: 20 - run: npm install -g appdmg - run: brew install imagemagick - name: Prepare if: ${{ env.is_notarized == 'true' }} run: | security create-keychain -p ${{ secrets.DEV_ID_PASSWORD }} buildagent security unlock-keychain -p ${{ secrets.DEV_ID_PASSWORD }} buildagent security list-keychains -s buildagent && security default-keychain -s buildagent echo ${{ secrets.DEV_ID_APP_CERT }} | base64 --decode > ./cert.p12 security import ./cert.p12 -P ${{ secrets.DEV_ID_PASSWORD }} -A -t cert -f pkcs12 -k buildagent -T /usr/bin/codesign >/dev/null rm ./cert.p12 echo ${{ secrets.DEV_ID_INST_CERT }} | base64 --decode > ./cert.p12 security import ./cert.p12 -P ${{ secrets.DEV_ID_PASSWORD }} -A -t cert -f pkcs12 -k buildagent -T /usr/bin/codesign >/dev/null rm ./cert.p12 security set-key-partition-list -S "apple-tool:,apple:,codesign:" -s -k ${{ secrets.DEV_ID_PASSWORD }} buildagent >/dev/null xcrun notarytool store-credentials "notary-installer" --apple-id ${{ secrets.DEV_USER_APPLE_ID }} --team-id ${{ secrets.DEV_TEAM_APPLE_ID }} --password ${{ secrets.DEV_SPEC_APP_PASSWORD }} >/dev/null echo ${{ secrets.PARTIELS_PROVISIONPROFILE }} | base64 --decode > ./Application_Partiels.provisionprofile ppuuid=`grep UUID -A1 -a ./Application_Partiels.provisionprofile | grep -io "[-A-F0-9]\{36\}"` mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles/ cp Application_Partiels.provisionprofile ~/Library/MobileDevice/Provisioning\ Profiles/$ppuuid.provisionprofile rm ./Application_Partiels.provisionprofile - name: Configure (no signing) if: ${{ env.is_notarized == 'false' }} run: cmake -B ${{ github.workspace }}/build -G "Xcode" -DPARTIELS_BUILD_TAG=${{ env.version_name }} - name: Configure if: ${{ env.is_notarized == 'true' }} run: cmake -B ${{ github.workspace }}/build -G "Xcode" -DPARTIELS_PROVISIONING_PROFILE_SPECIFIER="${{ secrets.PARTIELS_PROVISIONPROFILE_NAME }}" -DPARTIELS_DEVELOPMENT_TEAM="${{ secrets.DEV_TEAM_APPLE_ID }}" -DPARTIELS_BUILD_TAG=${{ env.version_name }} - name: Build (no signing) if: ${{ env.is_notarized == 'false' }} run: | set -o pipefail && cmake --build ${{ github.workspace }}/build --config ${{ env.build_type }} --target partiels-vamp-plugins | xcbeautify --renderer github-actions --disable-logging set -o pipefail && cmake --build ${{ github.workspace }}/build --config ${{ env.build_type }} --target vamp-example-plugins | xcbeautify --renderer github-actions --disable-logging set -o pipefail && xcodebuild archive -project "${{ github.workspace }}/build/Partiels.xcodeproj" -configuration ${{ env.build_type }} -scheme "Partiels" -archivePath "${{ github.workspace }}/build/Partiels.xcarchive" -destination platform=macOS | xcbeautify --renderer github-actions --disable-logging - name: Build if: ${{ env.is_notarized == 'true' }} run: | security unlock-keychain -p ${{ secrets.DEV_ID_PASSWORD }} buildagent security set-keychain-settings -lut 7200 buildagent set -o pipefail && cmake --build ${{ github.workspace }}/build --config ${{ env.build_type }} --target partiels-vamp-plugins | xcbeautify --renderer github-actions --disable-logging set -o pipefail && cmake --build ${{ github.workspace }}/build --config ${{ env.build_type }} --target vamp-example-plugins | xcbeautify --renderer github-actions --disable-logging set -o pipefail && xcodebuild archive -project "${{ github.workspace }}/build/Partiels.xcodeproj" -configuration ${{ env.build_type }} -scheme "Partiels" -archivePath "${{ github.workspace }}/build/Partiels.xcarchive" -destination platform=macOS | xcbeautify --renderer github-actions --disable-logging - name: Test run: | rm ${{ github.workspace }}/build/Partiels_artefacts/${{ env.build_type }}/Partiels.app cp -r ${{ github.workspace }}/build/Partiels.xcarchive/Products/Applications/Partiels.app ${{ github.workspace }}/build/Partiels_artefacts/${{ env.build_type }} ctest -C ${{ env.build_type }} -VV --test-dir ${{ github.workspace }}/build --output-on-failure - name: Export run: xcodebuild -exportArchive -archivePath "${{ github.workspace }}/build/Partiels.xcarchive" -exportPath "${{ github.workspace }}/build" -exportOptionsPlist "${{ github.workspace }}/BinaryData/Resource/macos-export-archive.plist" - name: Notarize if: ${{ env.is_notarized == 'true' }} run: | ditto -c -k --keepParent "${{ github.workspace }}/build/Partiels.app" "${{ github.workspace }}/build/Partiels.zip" xcrun notarytool submit "${{ github.workspace }}/build/Partiels.zip" --keychain-profile "notary-installer" --wait > "${{ github.workspace }}/build/notarize.log" 2>&1 cat "${{ github.workspace }}/build/notarize.log" notaryid=$(awk '/^ id:/{sub(/^ id:/ , ""); print; exit}' "${{ github.workspace }}/build/notarize.log") xcrun notarytool log $notaryid --keychain-profile "notary-installer" xcrun stapler staple "${{ github.workspace }}/build/Partiels.app" xcrun stapler validate "${{ github.workspace }}/build/Partiels.app" - name: Build Disk Image (no signing) if: ${{ env.is_notarized == 'false' }} run: | appdmg "${{ github.workspace }}/BinaryData/Resource/macos-dmg-config-no-signing.json" "${{ github.workspace }}/build/Partiels-MacOS.dmg" xcrun rez -append "${{ github.workspace }}/BinaryData/Resource/macos-dmg-icon.rsrc" -o "${{ github.workspace }}/build/Partiels-MacOS.dmg" xcrun setFile -a C "${{ github.workspace }}/build/Partiels-MacOS.dmg" - name: Build Disk Image if: ${{ env.is_notarized == 'true' }} run: | appdmg "${{ github.workspace }}/BinaryData/Resource/macos-dmg-config.json" "${{ github.workspace }}/build/Partiels-MacOS.dmg" xcrun rez -append "${{ github.workspace }}/BinaryData/Resource/macos-dmg-icon.rsrc" -o "${{ github.workspace }}/build/Partiels-MacOS.dmg" xcrun setFile -a C "${{ github.workspace }}/build/Partiels-MacOS.dmg" - name: Package dSYM Archive run: ditto -c -k --keepParent "${{ github.workspace }}/build/Partiels_artefacts/${{ env.build_type }}/Partiels.app.dSYM" "${{ github.workspace }}/build/Partiels-MacOS.dSYM.zip" - name: Notarize Disk Image if: ${{ env.is_notarized == 'true' }} run: | xcrun notarytool submit "${{ github.workspace }}/build/Partiels-MacOS.dmg" --keychain-profile "notary-installer" --wait > "${{ github.workspace }}/build/notarize.log" 2>&1 cat "${{ github.workspace }}/build/notarize.log" notaryid=$(awk '/^ id:/{sub(/^ id:/ , ""); print; exit}' "${{ github.workspace }}/build/notarize.log") xcrun notarytool log $notaryid --keychain-profile "notary-installer" xcrun stapler staple "${{ github.workspace }}/build/Partiels-MacOS.dmg" xcrun stapler validate "${{ github.workspace }}/build/Partiels-MacOS.dmg" - name: Artifact uses: actions/upload-artifact@v7.0.1 with: name: Partiels-MacOS path: | ${{ github.workspace }}/build/Partiels-MacOS.dmg ${{ github.workspace }}/build/Partiels-MacOS.dSYM.zip - name: Release uses: softprops/action-gh-release@v3 if: ${{ env.is_release == 'true' }} with: draft: true prerelease: true fail_on_unmatched_files: true generate_release_notes: true body_path: ${{ github.workspace }}/build/Partiels-Release.md files: | ${{ github.workspace }}/build/Partiels-MacOS.dmg ${{ github.workspace }}/build/Partiels-MacOS.dSYM.zip # Generates the documentation. Doc: runs-on: ubuntu-latest needs: Format steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version: 20 - run: npm install -g git+https://github.com/elliotblackburn/mdpdf.git#3.0.4 - name: Configure run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.build_type }} -DPARTIELS_BUILD_TAG=${{ env.version_name }} -DPARTIELS_MANUAL_ONLY=ON - name: Build run: | cmake --build ${{ github.workspace }}/build --target PartielsManual cmake --build ${{ github.workspace }}/build --target PartielsPatchs - name: Artifact uses: actions/upload-artifact@v7.0.1 with: name: Partiels-Manual path: ${{ github.workspace }}/build/Partiels-Manual.pdf - name: Artifact uses: actions/upload-artifact@v7.0.1 with: name: Partiels-Patchs path: ${{ github.workspace }}/build/Partiels-Patchs.zip - name: Release uses: softprops/action-gh-release@v3 if: ${{ env.is_release == 'true' && env.is_notarized == 'true' }} with: draft: true prerelease: true fail_on_unmatched_files: true generate_release_notes: true body_path: ${{ github.workspace }}/build/Partiels-Release.md files: | ${{ github.workspace }}/build/Partiels-Manual.pdf ${{ github.workspace }}/build/Partiels-Patchs.zip