-
Notifications
You must be signed in to change notification settings - Fork 17
325 lines (272 loc) · 9.69 KB
/
build-native.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
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
name: Build Native
on:
pull_request:
push:
tags:
- '@appland/appmap-v*'
jobs:
linux-x64:
runs-on: ubuntu-latest
if:
${{ contains(github.event.pull_request.labels.*.name, 'build native') ||
startsWith(github.ref, 'refs/tags/@appland/appmap-v') }}
env:
PUPPETEER_SKIP_DOWNLOAD: 1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Build
run: |
yarn build
cd packages/cli
yarn build-native linux x64
${GITHUB_WORKSPACE}/bin/hash release/appmap-linux-x64
- name: Publish appmap-linux-x64 artifact
uses: actions/upload-artifact@v4
with:
name: appmap-linux-x64
path: packages/cli/release/appmap-linux-x64
- name: 'Release: appmap-linux-x64'
uses: svenstaro/upload-release-action@v2
if: github.ref_type == 'tag'
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: packages/cli/release/appmap-linux-x64
asset_name: appmap-linux-x64
tag: ${{ github.ref }}
overwrite: true
- name: 'Release: appmap-linux-x64.sha256'
uses: svenstaro/upload-release-action@v2
if: github.ref_type == 'tag'
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: packages/cli/release/appmap-linux-x64.sha256
asset_name: appmap-linux-x64.sha256
tag: ${{ github.ref }}
overwrite: true
linux-arm64:
runs-on: linux-arm64
if:
${{ contains(github.event.pull_request.labels.*.name, 'build native') ||
startsWith(github.ref, 'refs/tags/@appland/appmap-v') }}
env:
PUPPETEER_SKIP_DOWNLOAD: 1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Build
run: |
yarn build
cd packages/cli
yarn build-native linux arm64
${GITHUB_WORKSPACE}/bin/hash release/appmap-linux-arm64
- name: Publish appmap-linux-arm64 artifact
uses: actions/upload-artifact@v4
with:
name: appmap-linux-arm64
path: packages/cli/release/appmap-linux-arm64
- name: 'Release: appmap-linux-arm64'
uses: svenstaro/upload-release-action@v2
if: github.ref_type == 'tag'
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: packages/cli/release/appmap-linux-arm64
asset_name: appmap-linux-arm64
tag: ${{ github.ref }}
overwrite: true
- name: 'Release: appmap-linux-arm64.sha256'
uses: svenstaro/upload-release-action@v2
if: github.ref_type == 'tag'
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: packages/cli/release/appmap-linux-arm64.sha256
asset_name: appmap-linux-arm64.sha256
tag: ${{ github.ref }}
overwrite: true
macos-x64:
runs-on: macos-12
if:
${{ contains(github.event.pull_request.labels.*.name, 'build native') ||
startsWith(github.ref, 'refs/tags/@appland/appmap-v') }}
env:
PUPPETEER_SKIP_DOWNLOAD: 1
APPLE_IDENTITY_PRIVATE_KEY: ${{ secrets.APPLE_IDENTITY_PRIVATE_KEY }}
APPLE_IDENTITY_CERTIFICATE: ${{ secrets.APPLE_IDENTITY_CERTIFICATE }}
APPLE_CONNECT_KEY_B64: ${{ secrets.APPLE_CONNECT_KEY_B64 }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install deps
run: |
python3 -m pip install --break-system-packages setuptools
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Build
run: |
yarn build
cd packages/cli
yarn build-native macos x64
${GITHUB_WORKSPACE}/bin/presign
${GITHUB_WORKSPACE}/bin/sign release/appmap-macos-x64
${GITHUB_WORKSPACE}/bin/notarize release/appmap-macos-x64
${GITHUB_WORKSPACE}/bin/hash release/appmap-macos-x64
- name: Publish appmap-macos-x64
uses: actions/upload-artifact@v4
with:
name: appmap-macos-x64
path: packages/cli/release/appmap-macos-x64
- name: 'Release: appmap-macos-x64'
uses: svenstaro/upload-release-action@v2
if: github.ref_type == 'tag'
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: packages/cli/release/appmap-macos-x64
asset_name: appmap-macos-x64
tag: ${{ github.ref }}
overwrite: true
- name: 'Release: appmap-macos-x64.sha256'
uses: svenstaro/upload-release-action@v2
if: github.ref_type == 'tag'
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: packages/cli/release/appmap-macos-x64.sha256
asset_name: appmap-macos-x64.sha256
tag: ${{ github.ref }}
overwrite: true
macos-arm:
runs-on: macos-14
if:
${{ contains(github.event.pull_request.labels.*.name, 'build native') ||
startsWith(github.ref, 'refs/tags/@appland/appmap-v') }}
env:
PUPPETEER_SKIP_DOWNLOAD: 1
APPLE_IDENTITY_PRIVATE_KEY: ${{ secrets.APPLE_IDENTITY_PRIVATE_KEY }}
APPLE_IDENTITY_CERTIFICATE: ${{ secrets.APPLE_IDENTITY_CERTIFICATE }}
APPLE_CONNECT_KEY_B64: ${{ secrets.APPLE_CONNECT_KEY_B64 }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install deps
run: |
python3 -m pip install --break-system-packages setuptools
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Restore cargo cache
uses: actions/cache@v3
with:
path: ~/.cargo
key: ${{ runner.os }}-${{ runner.arch }}-cargo
- name: Build
run: |
yarn build
cd packages/cli
yarn build-native macos arm64
${GITHUB_WORKSPACE}/bin/presign
${GITHUB_WORKSPACE}/bin/sign release/appmap-macos-arm64
${GITHUB_WORKSPACE}/bin/notarize release/appmap-macos-arm64
${GITHUB_WORKSPACE}/bin/hash release/appmap-macos-arm64
- name: Publish appmap-macos-arm64
uses: actions/upload-artifact@v4
with:
name: appmap-macos-arm64
path: packages/cli/release/appmap-macos-arm64
- name: 'Release: appmap-macos-arm64'
uses: svenstaro/upload-release-action@v2
if: github.ref_type == 'tag'
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: packages/cli/release/appmap-macos-arm64
asset_name: appmap-macos-arm64
tag: ${{ github.ref }}
overwrite: true
- name: 'Release: appmap-macos-arm64.sha256'
uses: svenstaro/upload-release-action@v2
if: github.ref_type == 'tag'
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: packages/cli/release/appmap-macos-arm64.sha256
asset_name: appmap-macos-arm64.sha256
tag: ${{ github.ref }}
overwrite: true
windows:
runs-on: windows-latest
if:
${{ contains(github.event.pull_request.labels.*.name, 'build native') ||
startsWith(github.ref, 'refs/tags/@appland/appmap-v') }}
env:
PUPPETEER_SKIP_DOWNLOAD: 1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Restore cargo cache
uses: actions/cache@v3
with:
path: ~/.cargo
key: ${{ runner.os }}-${{ runner.arch }}-cargo
- name: Build
shell: bash
run: |
choco install rsync
yarn build
cd packages/cli
yarn build-native win x64
node ${GITHUB_WORKSPACE}/bin/hash.js release/appmap-win-x64.exe
- name: Sign the release with Trusted Signing
uses: azure/[email protected]
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: https://eus.codesigning.azure.net/
code-signing-account-name: appmap
certificate-profile-name: appmap
files-folder: ${{ github.workspace }}/packages/cli/release/
files-folder-filter: exe,dll
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Publish appmap-win-x64
uses: actions/upload-artifact@v4
with:
name: appmap-win-x64
path: packages/cli/release/appmap-win-x64.exe
- name: 'Release: appmap-win-x64.exe'
uses: svenstaro/upload-release-action@v2
if: github.ref_type == 'tag'
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: packages/cli/release/appmap-win-x64.exe
asset_name: appmap-win-x64.exe
tag: ${{ github.ref }}
overwrite: true
- name: 'Release: appmap-win-x64.exe.sha256'
uses: svenstaro/upload-release-action@v2
if: github.ref_type == 'tag'
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: packages/cli/release/appmap-win-x64.exe.sha256
asset_name: appmap-win-x64.exe.sha256
tag: ${{ github.ref }}
overwrite: true
finalize-release:
name: finalize release
if: ${{ startsWith(github.ref, 'refs/tags/@appland/appmap-v') }}
runs-on: ubuntu-latest
needs:
- linux-x64
- linux-arm64
- macos-x64
- macos-arm
- windows
steps:
- name: Checkout
uses: actions/checkout@v3
- run: yarn npm tag add `echo ${{ github.ref_name }} | sed -e s/-v/@/` latest
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.YARN_NPM_AUTH_TOKEN }}