Add Linux support #110
Workflow file for this run
This file contains 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: | |
env: | |
ninja-version: '1.11.1' | |
clang-version: '18.1.8' | |
sha-length: 7 | |
jobs: | |
prepare-package: | |
runs-on: ${{matrix.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest] | |
compiler: [MSVC, Clang] | |
include: | |
- os: windows-latest | |
compiler: MSVC | |
vcpkg_triplet: x64-windows | |
- os: windows-latest | |
compiler: Clang | |
vcpkg_triplet: x64-windows-llvm | |
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: 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: Export GitHub Actions Cache Environment Variables | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- name: Install Packages | |
working-directory: ${{github.workspace}}/vcpkg | |
shell: pwsh | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
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/[email protected] | |
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] | |
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: 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' | |
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: 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: Export GitHub Actions Cache Environment Variables | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- name: Install Packages | |
working-directory: ${{github.workspace}}/vcpkg | |
shell: pwsh | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
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: 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/[email protected] | |
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 |