-
Notifications
You must be signed in to change notification settings - Fork 158
195 lines (166 loc) · 5 KB
/
Copy pathwindows.yml
File metadata and controls
195 lines (166 loc) · 5 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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Windows
on: [push, pull_request]
permissions: read-all
jobs:
build:
runs-on: ${{ matrix.os }}
name: Build - ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
artifact: ykman-builds-windows-x64
- os: windows-11-arm
artifact: ykman-builds-windows-arm64
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build Rust CLI
shell: bash
run: |
cargo build --release -p ykman-cli
mkdir -p dist/ykman
cp target/release/ykman.exe dist/ykman/
dist/ykman/ykman.exe --version
- name: Copy scripts
shell: bash
run: cp -r resources/win dist/scripts
- name: Build installer
if: matrix.os == 'windows-latest'
working-directory: ./dist
run: .\scripts\make_msi.ps1
- name: Upload build
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.artifact }}
path: dist
sign-exe:
if: startsWith(github.ref, 'refs/tags/')
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Check tag format
run: |
if [[ "${GITHUB_REF}" =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$ ]]; then
echo "Tag matches format"
else
echo "Invalid tag format"
exit 1
fi
- uses: actions/checkout@v6
- name: download artifacts
uses: actions/download-artifact@v5
with:
name: ykman-builds-windows-x64
path: ykman-builds-windows
- name: docker login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ci@yubico.com
password: ${{ secrets.GITHUB_TOKEN }}
- name: write service account credentials
env:
GAC: ${{ secrets.SCRIBE_SA }}
run: |
echo "${GAC}" > scribe_sa.json
echo "GOOGLE_APPLICATION_CREDENTIALS=/scribe/scribe_sa.json" >> $GITHUB_ENV
- name: run scribe sign exe
run: >
docker run
--user $(id -u):$(id -g)
--volume $(pwd):/scribe
--env-file <(env)
ghcr.io/yubico/scribe-ci:v1
--project-id scribe-prod-987134
--bucket scribe-u-pub-ykman-fqj0hy
--config /scribe/.github/scribe-sign-exe-dll.yml
submit .
--synchronous
--download-artifacts
- name: unpack signed exe
run: |
mkdir -p signed
mv scribe-download/*/sign-source/1.zip signed/
rm -rf scribe-download
cd signed
unzip -j 1.zip || true
rm 1.zip
cd ..
cp signed/ykman.exe ykman-builds-windows/ykman/ykman.exe
- name: upload signed artifacts
uses: actions/upload-artifact@v4
with:
name: signed-files
path: ykman-builds-windows
build-msi:
needs: [sign-exe]
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: download artifacts
uses: actions/download-artifact@v5
with:
name: signed-files
path: ykman-builds-windows
- name: Build installer
working-directory: .\ykman-builds-windows
run: .\scripts\make_msi.ps1
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: ykman-installer-windows
path: .\ykman-builds-windows
sign-msi:
needs: [build-msi]
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v6
- name: download artifacts
uses: actions/download-artifact@v5
with:
name: ykman-installer-windows
path: ykman-builds-windows
- name: docker login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ci@yubico.com
password: ${{ secrets.GITHUB_TOKEN }}
- name: write service account credentials
env:
GAC: ${{ secrets.SCRIBE_SA }}
run: |
echo "${GAC}" > scribe_sa.json
echo "GOOGLE_APPLICATION_CREDENTIALS=/scribe/scribe_sa.json" >> $GITHUB_ENV
- name: run scribe sign msi
run: >
docker run
--user $(id -u):$(id -g)
--volume $(pwd):/scribe
--env-file <(env)
ghcr.io/yubico/scribe-ci:v1
--project-id scribe-prod-987134
--bucket scribe-u-pub-ykman-fqj0hy
--config /scribe/.github/scribe-sign-msi.yml
submit .
--synchronous
--download-artifacts
- name: unpack signed msi
run: |
mkdir -p signed
mv scribe-download/*/sign-source/1.zip signed/
rm -rf scribe-download
cd signed
unzip -j 1.zip || true
rm 1.zip
cd ..
cp signed/ykman.msi ykman-builds-windows/ykman.msi
- name: upload signed artifacts
uses: actions/upload-artifact@v4
with:
name: signed-files-and-msi
path: ykman-builds-windows