-
Notifications
You must be signed in to change notification settings - Fork 12
447 lines (383 loc) · 18.7 KB
/
publish.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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
name: Publish AD4M
on:
push:
branches:
- main
jobs:
create-release:
runs-on: GH-hosted-ubuntu
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.32.4
- name: Create Tags From
id: create_tag
uses: jaywcjlove/[email protected]
- name: create release ad4m launcher
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.create_tag.outputs.version }}
release_name: AD4M Launcher & Cli ${{ steps.create_tag.outputs.version }}
body: See the assets to download this version and install.
draft: true
prerelease: false
build-launcher-binary:
strategy:
fail-fast: false
matrix:
platform: [GH-hosted-ubuntu, macos-latest, windows-latest]
node-version: [16.x]
needs:
- create-release
- npm-publish
runs-on: ${{ matrix.platform }}
steps:
- name: Fetch source code
uses: actions/checkout@v2
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: 1.76.0
- run: rustup target add wasm32-unknown-unknown
- name: Install GO
uses: actions/setup-go@v4
with:
go-version: '1.20.6'
- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.32.4
- uses: pnpm/action-setup@v2
with:
version: 8
- name: install dependencies (ubuntu only)
if: matrix.platform == 'GH-hosted-ubuntu'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf protobuf-compiler cmake
- name: install dependencies (macos only)
if: matrix.platform == 'macos-latest'
run: brew install protobuf cmake
- name: install dependencies (windows only)
if: matrix.platform == 'windows-latest'
run: choco install strawberryperl protoc cmake curl cygwin gnuwin32-m4 msys2 make mingw
- name: get version
run: echo "PACKAGE_VERSION=$(node -p "require('./ui/package.json').version")" >> $GITHUB_ENV
- name: Extract version
id: extract_version
uses: Saionaro/[email protected]
with:
path: ui
- name: Change package UI version
id: changed_version
if: matrix.platform == 'windows-latest'
run: cd ui && pnpm change-ui-version
- name: Extract changed version
id: changed_extract_version
uses: Saionaro/[email protected]
with:
path: ui
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: pnpm Install
run: pnpm install
- name: Install core dependencies
run: cd ./core && pnpm install
- name: Build AD4M-CLI & build Launcher binary (macos/linux-latest)
if: matrix.platform != 'windows-latest'
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
run: pnpm run package-ad4m
- name: Build AD4M-CLI & build Launcher binary (windows-latest)
if: matrix.platform == 'windows-latest'
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
run: pnpm run package-ad4m
- name: Upload Release Deb Asset
id: upload-release-deb-asset
if: matrix.platform == 'GH-hosted-ubuntu'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.deb
asset_name: adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.deb
asset_content_type: application/octet-stream
- name: Upload Release AppImage Asset
id: upload-release-appimage-asset
if: matrix.platform == 'GH-hosted-ubuntu'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/appimage/adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.AppImage
asset_name: adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.AppImage
asset_content_type: application/octet-stream
- name: Upload Release AppImage Update Asset
id: upload-release-appimage-asset-update
if: matrix.platform == 'GH-hosted-ubuntu'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/appimage/adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.AppImage.tar.gz
asset_name: adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz
asset_content_type: application/octet-stream
- name: Upload Release AppImage update sig Asset
id: upload-release-appimage-asset-update-sig
if: matrix.platform == 'GH-hosted-ubuntu'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/appimage/adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.AppImage.tar.gz.sig
asset_name: adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz.sig
asset_content_type: application/octet-stream
- name: Upload Release AD4M CLI Linux Binary
id: upload-release-linux-ad4m-cli-binary
if: matrix.platform == 'GH-hosted-ubuntu'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/ad4m/ad4m/target/release/ad4m
asset_name: ad4m-linux-${{ steps.extract_version.outputs.version }}-x64
asset_content_type: application/octet-stream
- name: Upload Release Macos Asset
id: upload-release-macos-asset
if: matrix.platform == 'macos-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: "/Users/runner/work/ad4m/ad4m/target/release/bundle/dmg/ADAM Launcher_${{ steps.extract_version.outputs.version }}_x64.dmg"
asset_name: ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64.dmg
asset_content_type: application/octet-stream
- name: Upload Release Macos update Asset
id: upload-release-macos-asset-update
if: matrix.platform == 'macos-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: "/Users/runner/work/ad4m/ad4m/target/release/bundle/macos/ADAM Launcher.app.tar.gz"
asset_name: ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64.app.tar.gz
asset_content_type: application/octet-stream
- name: Upload Release Macos update sig Asset
id: upload-release-macos-asset-update-sig
if: matrix.platform == 'macos-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: "/Users/runner/work/ad4m/ad4m/target/release/bundle/macos/ADAM Launcher.app.tar.gz.sig"
asset_name: ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64.app.tar.gz.sig
asset_content_type: application/octet-stream
- name: Upload Release AD4M CLI Macos Binary
id: upload-release-macos-ad4m-cli-binary
if: matrix.platform == 'macos-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /Users/runner/work/ad4m/ad4m/target/release/ad4m
asset_name: ad4m-macos-${{ steps.extract_version.outputs.version }}-x64
asset_content_type: application/octet-stream
- name: Upload Release MSI Asset
id: upload-release-msi-asset
if: matrix.platform == 'windows-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: 'D:\a\ad4m\ad4m\target\release\bundle\msi\ADAM Launcher_${{ steps.changed_extract_version.outputs.version }}_x64_en-US.msi'
asset_name: ADAM\ Launcher_${{ steps.changed_extract_version.outputs.version }}_x64_en-US.msi
asset_content_type: application/octet-stream
- name: Upload Release MSI update Asset
id: upload-release-msi-asset-update
if: matrix.platform == 'windows-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: 'D:\a\ad4m\ad4m\target\release\bundle\msi\ADAM Launcher_${{ steps.changed_extract_version.outputs.version }}_x64_en-US.msi.zip'
asset_name: ADAM\ Launcher_${{ steps.changed_extract_version.outputs.version }}_x64_en-US.msi.zip
asset_content_type: application/octet-stream
- name: Upload Release MSI update sig Asset
id: upload-release-msi-asset-update-sig
if: matrix.platform == 'windows-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: 'D:\a\ad4m\ad4m\target\release\bundle\msi\ADAM Launcher_${{ steps.changed_extract_version.outputs.version }}_x64_en-US.msi.zip.sig'
asset_name: ADAM\ Launcher_${{ steps.changed_extract_version.outputs.version }}_x64_en-US.msi.zip.sig
asset_content_type: application/octet-stream
# - name: Upload Release AD4M CLI Windows Binary
# id: upload-release-windows-ad4m-cli-binary
# if: matrix.platform == 'windows-latest'
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: D:\a\ad4m\ad4m\target\release\ad4m-x64.exe
# asset_name: ad4m-windows-${{ steps.extract_version.outputs.version }}-x64.exe
# asset_content_type: application/octet-stream
npm-publish:
runs-on: GH-hosted-ubuntu
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Install deps
run: pnpm install
- name: Install core dependencies
run: cd ./core && pnpm install
- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.32.4
- name: Install GO
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Install Linux Deps
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf protobuf-compiler cmake
- name: Build modules
run: pnpm run build-libs
- name: Change Package Visibility to Public
run: |
cd core
sed -i 's/"private": true/"private": false/' package.json
- name: Publish core
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.COASYS_NPM_TOKEN }}
package: core/package.json
access: public
- name: Publish connect
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.COASYS_NPM_TOKEN }}
package: connect/package.json
access: public
- name: Publish ad4m hook helpers
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.COASYS_NPM_TOKEN }}
package: ad4m-hooks/helpers/package.json
tag: ${{ env.NPM_TAG }}
access: public
- name: Publish ad4m react hooks
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.COASYS_NPM_TOKEN }}
package: ad4m-hooks/react/package.json
tag: ${{ env.NPM_TAG }}
access: public
- name: Publish ad4m vue hooks
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.COASYS_NPM_TOKEN }}
package: ad4m-hooks/vue/package.json
tag: ${{ env.NPM_TAG }}
access: public
- name: Publish executor
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.COASYS_NPM_TOKEN }}
package: executor/package.json
access: public
- name: Publish Test runner
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.COASYS_NPM_TOKEN }}
package: test-runner/package.json
access: public
crates-publish:
runs-on: GH-hosted-ubuntu
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.76.0
override: true
- name: Install GO
uses: actions/setup-go@v4
with:
go-version: '1.22'
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Linux Deps
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf protobuf-compiler cmake
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Cache cargo
id: cache-cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo
restore-keys: ${{ runner.os }}-cargo
- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.32.4
- run: rustup target add wasm32-unknown-unknown
- run: pnpm install
- run: pnpm build-core-executor
- run: cargo install cargo-workspaces || echo "cargo-workspaces already installed"
- run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }}
- run: cargo workspaces publish --from-git