Add MIDI auto note length #204
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 Artifacts | |
| on: | |
| push: | |
| branches: [ "develop", "main" ] | |
| pull_request: | |
| branches: [ "develop", "main" ] | |
| workflow_call: | |
| concurrency: | |
| group: ${{github.workflow}}-${{github.ref}} | |
| cancel-in-progress: true | |
| env: | |
| ninja-version: '1.11.1' | |
| clang-version: '18.1.8' | |
| sha-length: 7 | |
| apt-source: | | |
| echo -e "Types: deb\nURIs: http://archive.ubuntu.com/ubuntu/\nSuites: jammy\nComponents: main restricted universe multiverse\nArchitectures: amd64" | sudo tee /etc/apt/sources.list.d/jammy.sources | |
| sudo apt install ca-certificates gnupg | |
| sudo gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF | |
| echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list | |
| linux-requirements: 'sudo apt install libasound2-dev libfreetype-dev libcurl4-openssl-dev libwebkit2gtk-4.0-dev libgtk-3-dev libtinfo5 patchelf mono-complete' | |
| USERNAME: Do-sth-sharp | |
| VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg | |
| FEED_URL: https://nuget.pkg.github.com/Do-sth-sharp/index.json | |
| VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/Do-sth-sharp/index.json,readwrite" | |
| jobs: | |
| prepare-package: | |
| runs-on: ${{matrix.os}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] | |
| compiler: [MSVC, Clang] | |
| include: | |
| - os: windows-latest | |
| compiler: MSVC | |
| vcpkg_triplet: x64-windows | |
| - os: windows-latest | |
| compiler: Clang | |
| vcpkg_triplet: x64-windows-llvm | |
| - os: ubuntu-latest | |
| compiler: Clang | |
| vcpkg_triplet: x64-linux-llvm | |
| exclude: | |
| - os: ubuntu-latest | |
| compiler: MSVC | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Setup Ninja | |
| uses: seanmiddleditch/gha-setup-ninja@master | |
| with: | |
| version: ${{env.ninja-version}} | |
| - name: Install vcpkg Windows | |
| if: runner.os == 'Windows' | |
| working-directory: ${{github.workspace}}/vcpkg | |
| shell: cmd | |
| run: .\bootstrap-vcpkg.bat | |
| - name: Install vcpkg Linux | |
| if: runner.os == 'Linux' | |
| working-directory: ${{github.workspace}}/vcpkg | |
| shell: bash | |
| run: bash ./bootstrap-vcpkg.sh | |
| - name: Initialize MSVC Environment | |
| if: matrix.compiler == 'MSVC' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: ${{runner.arch}} | |
| - name: Initialize Clang Compiler | |
| if: matrix.compiler == 'Clang' | |
| uses: KyleMayes/install-llvm-action@v2 | |
| with: | |
| version: ${{env.clang-version}} | |
| directory: ${{runner.temp}}/llvm | |
| - name: Set Linux APT Source | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: ${{env.apt-source}} | |
| - name: Update Linux APT Source | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: 'sudo apt update' | |
| - name: Install Linux Requirements | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: ${{env.linux-requirements}} | |
| - name: Add NuGet Sources Windows | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| .$(${{ env.VCPKG_EXE }} fetch nuget) ` | |
| sources add ` | |
| -Source "${{ env.FEED_URL }}" ` | |
| -StorePasswordInClearText ` | |
| -Name GitHubPackages ` | |
| -UserName "${{ env.USERNAME }}" ` | |
| -Password "${{ secrets.GH_PACKAGES_TOKEN }}" | |
| .$(${{ env.VCPKG_EXE }} fetch nuget) ` | |
| setapikey "${{ secrets.GH_PACKAGES_TOKEN }}" ` | |
| -Source "${{ env.FEED_URL }}" | |
| - name: Add NuGet Sources Linux | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \ | |
| sources add \ | |
| -Source "${{ env.FEED_URL }}" \ | |
| -StorePasswordInClearText \ | |
| -Name GitHubPackages \ | |
| -UserName "${{ env.USERNAME }}" \ | |
| -Password "${{ secrets.GH_PACKAGES_TOKEN }}" | |
| mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \ | |
| setapikey "${{ secrets.GH_PACKAGES_TOKEN }}" \ | |
| -Source "${{ env.FEED_URL }}" | |
| - name: Install Packages | |
| working-directory: ${{github.workspace}}/vcpkg | |
| shell: pwsh | |
| run: ./vcpkg install --x-manifest-root=../scripts/vcpkg-manifest --x-install-root=./installed --triplet=${{matrix.vcpkg_triplet}} | |
| - name: Get Short SHA | |
| if: ${{!cancelled()}} | |
| uses: benjlevesque/short-sha@v3.0 | |
| id: short-sha | |
| with: | |
| length: ${{env.sha-length}} | |
| - name: Archive vcpkg Logs | |
| if: ${{!cancelled()}} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vcpkglogs-${{runner.os}}-${{runner.arch}}-${{matrix.compiler}}-${{steps.short-sha.outputs.sha}} | |
| path: | | |
| vcpkg/buildtrees/*/*.log | |
| retention-days: 7 | |
| compression-level: 9 | |
| build: | |
| runs-on: ${{matrix.os}} | |
| needs: [prepare-package] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] | |
| build_type: [Debug, Release] | |
| compiler: [MSVC, Clang] | |
| include: | |
| - os: windows-latest | |
| compiler: MSVC | |
| vcpkg_triplet: x64-windows | |
| - os: windows-latest | |
| compiler: Clang | |
| vcpkg_triplet: x64-windows-llvm | |
| - os: ubuntu-latest | |
| compiler: Clang | |
| vcpkg_triplet: x64-linux-llvm | |
| - os: windows-latest | |
| build_type: Debug | |
| compiler: MSVC | |
| cmake_config: 'Ninja Debug x64' | |
| build_path: 'ninja-debug-x64' | |
| - os: windows-latest | |
| build_type: Release | |
| compiler: MSVC | |
| cmake_config: 'Ninja Release x64' | |
| build_path: 'ninja-release-x64' | |
| - os: windows-latest | |
| build_type: Debug | |
| compiler: Clang | |
| cmake_config: 'Ninja Debug Win64 LLVM' | |
| build_path: 'ninja-debug-win64-llvm' | |
| - os: windows-latest | |
| build_type: Release | |
| compiler: Clang | |
| cmake_config: 'Ninja Release Win64 LLVM' | |
| build_path: 'ninja-release-win64-llvm' | |
| - os: ubuntu-latest | |
| build_type: Debug | |
| compiler: Clang | |
| cmake_config: 'Ninja Debug Linux LLVM' | |
| build_path: 'ninja-debug-linux-llvm' | |
| lib_path: 'debug/lib' | |
| - os: ubuntu-latest | |
| build_type: Release | |
| compiler: Clang | |
| cmake_config: 'Ninja Release Linux LLVM' | |
| build_path: 'ninja-release-linux-llvm' | |
| lib_path: 'lib' | |
| exclude: | |
| - os: ubuntu-latest | |
| compiler: MSVC | |
| permissions: | |
| id-token: write | |
| contents: read | |
| attestations: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Setup Ninja | |
| uses: seanmiddleditch/gha-setup-ninja@master | |
| with: | |
| version: ${{env.ninja-version}} | |
| - name: Install vcpkg Windows | |
| if: runner.os == 'Windows' | |
| working-directory: ${{github.workspace}}/vcpkg | |
| shell: cmd | |
| run: .\bootstrap-vcpkg.bat | |
| - name: Install vcpkg Linux | |
| if: runner.os == 'Linux' | |
| working-directory: ${{github.workspace}}/vcpkg | |
| shell: bash | |
| run: bash ./bootstrap-vcpkg.sh | |
| - name: Initialize MSVC Environment | |
| if: matrix.compiler == 'MSVC' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: ${{runner.arch}} | |
| - name: Initialize Clang Compiler | |
| if: matrix.compiler == 'Clang' | |
| uses: KyleMayes/install-llvm-action@v2 | |
| with: | |
| version: ${{env.clang-version}} | |
| directory: ${{runner.temp}}/llvm | |
| - name: Set Linux APT Source | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: ${{env.apt-source}} | |
| - name: Update Linux APT Source | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: 'sudo apt update' | |
| - name: Install Linux Requirements | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: ${{env.linux-requirements}} | |
| - name: Add NuGet Sources Windows | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| .$(${{ env.VCPKG_EXE }} fetch nuget) ` | |
| sources add ` | |
| -Source "${{ env.FEED_URL }}" ` | |
| -StorePasswordInClearText ` | |
| -Name GitHubPackages ` | |
| -UserName "${{ env.USERNAME }}" ` | |
| -Password "${{ secrets.GH_PACKAGES_TOKEN }}" | |
| .$(${{ env.VCPKG_EXE }} fetch nuget) ` | |
| setapikey "${{ secrets.GH_PACKAGES_TOKEN }}" ` | |
| -Source "${{ env.FEED_URL }}" | |
| - name: Add NuGet Sources Linux | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \ | |
| sources add \ | |
| -Source "${{ env.FEED_URL }}" \ | |
| -StorePasswordInClearText \ | |
| -Name GitHubPackages \ | |
| -UserName "${{ env.USERNAME }}" \ | |
| -Password "${{ secrets.GH_PACKAGES_TOKEN }}" | |
| mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \ | |
| setapikey "${{ secrets.GH_PACKAGES_TOKEN }}" \ | |
| -Source "${{ env.FEED_URL }}" | |
| - name: Install Packages | |
| working-directory: ${{github.workspace}}/vcpkg | |
| shell: pwsh | |
| run: ./vcpkg install --x-manifest-root=../scripts/vcpkg-manifest --x-install-root=./installed --triplet=${{matrix.vcpkg_triplet}} | |
| - name: Configure CMake | |
| working-directory: ${{github.workspace}} | |
| shell: pwsh | |
| run: cmake --preset "${{matrix.cmake_config}}" | |
| - name: Build | |
| working-directory: ${{github.workspace}} | |
| shell: pwsh | |
| run: cmake --build "build/${{matrix.build_path}}" --target VocalShaper | |
| - name: Patch ELF RPATH on Linux | |
| if: runner.os == 'Linux' | |
| working-directory: ${{github.workspace}} | |
| shell: pwsh | |
| run: ./scripts/ci/patchELF.ps1 -DirectoryPath "./build/${{matrix.build_path}}/bin" -RPath '$ORIGIN' -Recurse | |
| - name: Patch Engine ELF RPATH on Linux | |
| if: runner.os == 'Linux' | |
| working-directory: ${{github.workspace}} | |
| shell: pwsh | |
| run: ./scripts/ci/patchELF.ps1 -DirectoryPath "./build/${{matrix.build_path}}/bin/synth-engines/*.vst3/Contents/*-linux/*.so" -RPath '$ORIGIN:$ORIGIN/../../../..' | |
| - name: Copy Dynamic Library on Linux | |
| if: runner.os == 'Linux' | |
| working-directory: ${{github.workspace}} | |
| shell: pwsh | |
| run: ./scripts/ci/copySoLib.ps1 "./vcpkg/installed/${{matrix.vcpkg_triplet}}/${{matrix.lib_path}}" "./build/${{matrix.build_path}}/bin" | |
| - name: Pre Packing | |
| working-directory: ${{github.workspace}} | |
| shell: pwsh | |
| run: ./scripts/ci/prePacking.ps1 -DirectoryPath "./build/${{matrix.build_path}}/bin" | |
| - name: Find Binary Files | |
| id: find-binary | |
| working-directory: ${{github.workspace}} | |
| shell: pwsh | |
| run: | | |
| $result = (./scripts/ci/findBinary.ps1 -DirectoryPath "./build/${{matrix.build_path}}/bin") | Out-String | |
| $outputString = "exec_files=$result" | |
| $outputString | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| Write-Host "Found executable and dynamic library files: $result" | |
| - name: Generate Artifact Attestation | |
| if: github.event_name != 'pull_request' | |
| uses: actions/attest-build-provenance@v1 | |
| with: | |
| subject-path: '${{steps.find-binary.outputs.exec_files}}' | |
| - name: Get Short SHA | |
| uses: benjlevesque/short-sha@v3.0 | |
| id: short-sha | |
| with: | |
| length: ${{env.sha-length}} | |
| - name: Archive Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: VocalShaper-${{runner.os}}-${{runner.arch}}-${{matrix.compiler}}-${{matrix.build_type}}-${{steps.short-sha.outputs.sha}} | |
| path: | | |
| build/${{matrix.build_path}}/bin/** | |
| compression-level: 9 |