-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.7 KB
/
Copy pathbuild.yml
File metadata and controls
52 lines (45 loc) · 1.7 KB
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
name: build
on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]
workflow_dispatch:
permissions:
contents: write # needed to publish a Release on tag pushes
jobs:
build:
runs-on: windows-latest
# Map secrets to env here — the `secrets` context can't be used in a step `if:`.
env:
SIGN_PFX_BASE64: ${{ secrets.SIGN_PFX_BASE64 }}
SIGN_PFX_PASSWORD: ${{ secrets.SIGN_PFX_PASSWORD }}
steps:
- uses: actions/checkout@v4
# Uses the in-box .NET Framework C# compiler that ships on the runner — no SDK needed.
- name: Build
shell: pwsh
run: ./build.ps1
# Optional code signing: only runs if you add the SIGN_PFX_BASE64 repo secret
# (and SIGN_PFX_PASSWORD). Without it, the build is unsigned and this step is skipped.
- name: Sign (optional)
if: ${{ env.SIGN_PFX_BASE64 != '' }}
shell: pwsh
run: |
$pfx = Join-Path $env:RUNNER_TEMP cert.pfx
[IO.File]::WriteAllBytes($pfx, [Convert]::FromBase64String($env:SIGN_PFX_BASE64))
$signtool = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\signtool.exe" |
Sort-Object FullName | Select-Object -Last 1
& $signtool.FullName sign /f $pfx /p $env:SIGN_PFX_PASSWORD /fd SHA256 `
/tr http://timestamp.digicert.com /td SHA256 bin\LoadView.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: LoadView
path: bin/LoadView.exe
- name: Release on tag
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: bin/LoadView.exe