-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (57 loc) · 2.07 KB
/
Copy pathrelease.yml
File metadata and controls
70 lines (57 loc) · 2.07 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Build & Release
on:
push:
tags:
- "v*"
env:
SIGNPATH_PROJECT_SLUG: dartlab-desktop
SIGNPATH_SIGNING_POLICY_SLUG: release
permissions:
contents: write
id-token: write
attestations: write
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Build release
run: cargo build --release
- name: Rename exe
run: |
copy target\release\dartlab-desktop.exe DartLab.exe
- name: Install SignPath PowerShell module
shell: pwsh
run: |
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name SignPath -MinimumVersion 4.0.0 -MaximumVersion 4.999.999 -Force -Scope CurrentUser
- name: Sign release binary with SignPath
shell: pwsh
env:
SIGNPATH_API_TOKEN: ${{ secrets.SIGNPATH_API_TOKEN }}
SIGNPATH_ORGANIZATION_ID: ${{ secrets.SIGNPATH_ORGANIZATION_ID }}
run: |
if (-not $env:SIGNPATH_API_TOKEN) { throw "Missing SIGNPATH_API_TOKEN secret" }
if (-not $env:SIGNPATH_ORGANIZATION_ID) { throw "Missing SIGNPATH_ORGANIZATION_ID secret" }
New-Item -ItemType Directory -Path signed -Force | Out-Null
Import-Module SignPath
Submit-SigningRequest `
-InputArtifactPath "DartLab.exe" `
-ProjectSlug "${env:SIGNPATH_PROJECT_SLUG}" `
-SigningPolicySlug "${env:SIGNPATH_SIGNING_POLICY_SLUG}" `
-OrganizationId $env:SIGNPATH_ORGANIZATION_ID `
-ApiToken $env:SIGNPATH_API_TOKEN `
-Description "GitHub release ${{ github.ref_name }}" `
-WaitForCompletion `
-OutputArtifactPath "signed\\DartLab.exe" `
-Force
- name: Attest build provenance
uses: actions/attest-build-provenance@v2
with:
subject-path: signed/DartLab.exe
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: signed/DartLab.exe
generate_release_notes: true