-
Notifications
You must be signed in to change notification settings - Fork 6
95 lines (88 loc) · 4.1 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
adc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup release flow
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
# Build and test ADC CLI
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- uses: pnpm/action-setup@v4
- name: Build ADC
env:
NODE_VERSION: 20.15.1
run: |
pnpm install
NODE_ENV=production npx nx build cli
node --experimental-sea-config apps/cli/node-sea.json
npx ts-node apps/cli/scripts/download-node.ts
npx postject ./node-binary/linux-amd64 NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
npx postject ./node-binary/linux-arm64 NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
npx postject ./node-binary/win-x64.exe NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
npx postject ./node-binary/win-arm64.exe NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
- name: Compress ADC
run: |
mkdir -p release
mv ./node-binary/linux-amd64 ./adc
tar -czf release/adc_${{ env.RELEASE_VERSION }}_linux_amd64.tar.gz ./adc && rm -rf ./adc
mv ./node-binary/linux-arm64 ./adc
tar -czf release/adc_${{ env.RELEASE_VERSION }}_linux_arm64.tar.gz ./adc && rm -rf ./adc
mv ./node-binary/win-x64.exe ./adc.exe
zip -r release/adc_${{ env.RELEASE_VERSION }}_windows_amd64.zip ./adc.exe && rm -rf ./adc.exe
mv ./node-binary/win-arm64.exe ./adc.exe
zip -r release/adc_${{ env.RELEASE_VERSION }}_windows_arm64.zip ./adc.exe && rm -rf ./adc.exe
- name: Upload ADC to GitHub release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
release/adc_${{ env.RELEASE_VERSION }}_linux_amd64.tar.gz
release/adc_${{ env.RELEASE_VERSION }}_linux_arm64.tar.gz
release/adc_${{ env.RELEASE_VERSION }}_windows_amd64.zip
release/adc_${{ env.RELEASE_VERSION }}_windows_arm64.zip
adc-macos:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Setup release flow
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
# Build and test ADC CLI
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- uses: pnpm/action-setup@v2
with:
version: latest
- name: Build ADC
run: |
pnpm install
NODE_ENV=production npx nx build cli
node --experimental-sea-config apps/cli/node-sea.json
npx ts-node apps/cli/scripts/download-node.ts
codesign --remove-signature ./node-binary/darwin-arm64
codesign --remove-signature ./node-binary/darwin-x64
npx postject ./node-binary/darwin-arm64 NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 --macho-segment-name NODE_SEA
npx postject ./node-binary/darwin-x64 NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 --macho-segment-name NODE_SEA
codesign --sign - ./node-binary/darwin-arm64
codesign --sign - ./node-binary/darwin-x64
- name: Compress ADC
run: |
mkdir release
mv ./node-binary/darwin-arm64 ./adc
tar -czf release/adc_${{ env.RELEASE_VERSION }}_darwin_arm64.tar.gz ./adc && rm -rf ./adc
mv ./node-binary/darwin-x64 ./adc
tar -czf release/adc_${{ env.RELEASE_VERSION }}_darwin_amd64.tar.gz ./adc && rm -rf ./adc
- name: Upload ADC to GitHub release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
release/adc_${{ env.RELEASE_VERSION }}_darwin_arm64.tar.gz
release/adc_${{ env.RELEASE_VERSION }}_darwin_amd64.tar.gz