@@ -3,57 +3,69 @@ name: Build
33on :
44 push :
55 tags : ['v*']
6+ workflow_dispatch :
7+
8+ permissions :
9+ contents : write
610
711jobs :
812 build :
913 runs-on : windows-latest
10- strategy :
11- matrix :
12- arch : [x64, ARM64]
1314
1415 steps :
1516 - uses : actions/checkout@v4
1617
17- - name : Configure CMake
18- run : cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }}
19-
20- - name : Build
21- run : cmake --build build --config Release
22-
23- - name : Upload artifact
24- uses : actions/upload-artifact@v4
25- with :
26- name : toasty-${{ matrix.arch }}
27- path : build/Release/toasty.exe
18+ - name : Build x64
19+ run : |
20+ cmake -S . -B build-x64 -G "Visual Studio 17 2022" -A x64
21+ cmake --build build-x64 --config Release
2822
29- release :
30- needs : build
31- runs-on : ubuntu-latest
32- if : startsWith(github.ref, 'refs/tags/v')
33- permissions :
34- contents : write
23+ - name : Build ARM64
24+ run : |
25+ cmake -S . -B build-arm64 -G "Visual Studio 17 2022" -A ARM64
26+ cmake --build build-arm64 --config Release
3527
36- steps :
37- - name : Download x64
38- uses : actions/download-artifact@v4
28+ - name : Azure Login
29+ uses : azure/login@v2
3930 with :
40- name : toasty-x64
41- path : x64
31+ creds : ' {"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}'
4232
43- - name : Download ARM64
44- uses : actions/download-artifact@v4
33+ - name : Sign executables with Trusted Signing
34+ uses : azure/trusted-signing-action@v0
4535 with :
46- name : toasty-ARM64
47- path : arm64
36+ azure-tenant-id : ${{ secrets.AZURE_TENANT_ID }}
37+ azure-client-id : ${{ secrets.AZURE_CLIENT_ID }}
38+ azure-client-secret : ${{ secrets.AZURE_CLIENT_SECRET }}
39+ endpoint : https://wus2.codesigning.azure.net/
40+ trusted-signing-account-name : hanselman
41+ certificate-profile-name : WindowsEdgeLight
42+ files-folder : ${{ github.workspace }}
43+ files-folder-filter : exe
44+ files-folder-recurse : true
45+ file-digest : SHA256
46+ timestamp-rfc3161 : http://timestamp.acs.microsoft.com
47+ timestamp-digest : SHA256
4848
49- - name : Rename binaries
49+ - name : Prepare release artifacts
50+ shell : pwsh
5051 run : |
51- mv x64/toasty.exe toasty-x64.exe
52- mv arm64/toasty.exe toasty-arm64.exe
52+ New-Item -ItemType Directory -Path artifacts -Force
53+ Copy-Item "build-x64/Release/toasty.exe" -Destination "artifacts/toasty-x64.exe"
54+ Copy-Item "build-arm64/Release/toasty.exe" -Destination "artifacts/toasty-arm64.exe"
55+
56+ - name : Upload artifacts
57+ uses : actions/upload-artifact@v4
58+ with :
59+ name : toasty-signed
60+ path : artifacts/*.exe
5361
5462 - name : Create Release
63+ if : startsWith(github.ref, 'refs/tags/v')
5564 uses : softprops/action-gh-release@v1
5665 with :
5766 files : |
58- toasty-x64.exe
59- toasty-arm64.exe
67+ artifacts/toasty-x64.exe
68+ artifacts/toasty-arm64.exe
69+ generate_release_notes : true
70+ env :
71+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments