-
-
Notifications
You must be signed in to change notification settings - Fork 5
164 lines (143 loc) · 4.8 KB
/
buildArtifacts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Build Artifacts
on:
push:
branches: [ "develop", "main" ]
pull_request:
branches: [ "develop", "main" ]
workflow_call:
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
build_type: [Debug, Release]
compiler: [MSVC, MinGW]
include:
- compiler: MSVC
c_compiler: cl
cxx_compiler: cl
asm_compiler: cl
- compiler: MinGW
c_compiler: gcc
cxx_compiler: c++
asm_compiler: ''
- os: windows-latest
compiler: MSVC
vcpkg_triplet: x64-windows
- os: windows-latest
compiler: MinGW
vcpkg_triplet: x64-mingw-dynamic
- 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: MinGW
cmake_config: 'Ninja Debug MinGW64'
build_path: 'ninja-debug-mingw64'
- os: windows-latest
build_type: Release
compiler: MinGW
cmake_config: 'Ninja Release MinGW64'
build_path: 'ninja-release-mingw64'
permissions:
id-token: write
contents: read
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Ninja
uses: ashutoshvarma/setup-ninja@master
with:
version: 1.11.0
- name: Install MinGW
if: matrix.compiler == 'MinGW'
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
static: 0
- 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: 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
env:
CC: ${{matrix.c_compiler}}
CXX: ${{matrix.cxx_compiler}}
ASM: ${{matrix.asm_compiler}}
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: 7
- 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
- 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