Skip to content

Commit be3186c

Browse files
Setup workflows
1 parent b956c0b commit be3186c

File tree

2 files changed

+60
-47
lines changed

2 files changed

+60
-47
lines changed

.github/workflows/pr.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@ on:
55
workflow_dispatch:
66

77
jobs:
8-
build:
8+
test:
9+
name: Test for ${{ matrix.os }}
910
runs-on: ${{ matrix.os }}
1011
strategy:
1112
matrix:
12-
os: [ubuntu-latest, windows-latest, macos-latest]
13+
include:
14+
- os: ubuntu-latest
15+
artifact_name: astgen-linux
16+
- os: windows-latest
17+
artifact_name: astgen-win.exe
18+
- os: macos-latest
19+
artifact_name: astgen-macos
1320
steps:
1421
- name: Checkout
1522
uses: actions/checkout@v4
@@ -28,38 +35,38 @@ jobs:
2835
- name: Test
2936
run: |
3037
yarn test
31-
- name: Create Windows Binaries
38+
- name: Create Windows binaries
3239
if: matrix.os == 'windows-latest'
3340
run: |
3441
node --experimental-sea-config sea-config.json
35-
node -e "require('fs').copyFileSync(process.execPath, 'astgen-win.exe')"
36-
npx postject astgen-win.exe NODE_SEA_BLOB sea-prep.blob --overwrite --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
37-
- name: Create Linux Binaries
42+
node -e "require('fs').copyFileSync(process.execPath, '${{ matrix.artifact_name }}')"
43+
npx postject ${{ matrix.artifact_name }} NODE_SEA_BLOB sea-prep.blob --overwrite --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
44+
- name: Create Linux binaries
3845
if: matrix.os == 'ubuntu-latest'
3946
run: |
4047
node --experimental-sea-config sea-config.json
41-
cp $(command -v node) astgen-linux
42-
npx postject astgen-linux NODE_SEA_BLOB sea-prep.blob --overwrite --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
43-
- name: Create MacOS Binaries
48+
cp $(command -v node) ${{ matrix.artifact_name }}
49+
npx postject ${{ matrix.artifact_name }} NODE_SEA_BLOB sea-prep.blob --overwrite --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
50+
- name: Create MacOS binaries
4451
if: matrix.os == 'macos-latest'
4552
run: |
4653
node --experimental-sea-config sea-config.json
47-
cp $(command -v node) astgen-macos
48-
codesign --remove-signature astgen-macos
49-
npx postject astgen-macos NODE_SEA_BLOB sea-prep.blob --overwrite --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 --macho-segment-name NODE_SEA
50-
codesign --sign - astgen-macos
54+
cp $(command -v node) ${{ matrix.artifact_name }}
55+
codesign --remove-signature ${{ matrix.artifact_name }}
56+
npx postject ${{ matrix.artifact_name }} NODE_SEA_BLOB sea-prep.blob --overwrite --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 --macho-segment-name NODE_SEA
57+
codesign --sign - ${{ matrix.artifact_name }}
5158
- name: Print version and size (Windows)
5259
if: matrix.os == 'windows-latest'
5360
run: |
5461
Get-ChildItem -File | Select-Object Name,@{Name="Size(MB)";Expression={ "{0:N2}" -f ($_.Length/1MB) }} | Format-Table -AutoSize
55-
.\astgen-win.exe --version
62+
echo "astgen version is:" $(.\${{ matrix.artifact_name }} --version)
5663
- name: Print version and size (Linux)
5764
if: matrix.os == 'ubuntu-latest'
5865
run: |
5966
ls -lh
60-
./astgen-linux --version
67+
echo "astgen version is:" $(./${{ matrix.artifact_name }} --version)
6168
- name: Print version and size (MacOS)
6269
if: matrix.os == 'macos-latest'
6370
run: |
6471
ls -lh
65-
./astgen-macos --version
72+
echo "astgen version is:" $(./${{ matrix.artifact_name }} --version)

.github/workflows/release.yml

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,18 @@ on:
88
concurrency: production
99

1010
jobs:
11-
build:
12-
runs-on: ubuntu-latest
11+
release:
12+
name: Release for ${{ matrix.os }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
include:
17+
- os: ubuntu-latest
18+
artifact_name: astgen-linux
19+
- os: windows-latest
20+
artifact_name: astgen-win.exe
21+
- os: macos-latest
22+
artifact_name: astgen-macos
1323
steps:
1424
- name: Checkout
1525
uses: actions/checkout@v4
@@ -18,12 +28,8 @@ jobs:
1828
- name: Install node
1929
uses: actions/setup-node@v4
2030
with:
21-
node-version: '18'
31+
node-version: '24'
2232
cache: 'yarn'
23-
- name: Install ldid
24-
uses: MOZGIII/install-ldid-action@v1
25-
with:
26-
tag: v2.1.5-procursus6
2733
- name: Get next release version (dry run)
2834
id: taggerDryRun
2935
uses: anothrNick/[email protected]
@@ -41,40 +47,40 @@ jobs:
4147
run: |
4248
yarn install
4349
yarn build
44-
yarn binary
50+
yarn bundle
4551
- name: Test
4652
run: |
4753
yarn test
48-
- name: Rename
54+
- name: Create Windows binaries
55+
if: matrix.os == 'windows-latest'
4956
run: |
50-
mv astgen-linux-x64 astgen-linux
51-
mv astgen-linux-arm64 astgen-linux-arm
52-
mv astgen-macos-x64 astgen-macos
53-
mv astgen-macos-arm64 astgen-macos-arm
54-
mv astgen-win-x64.exe astgen-win.exe
55-
- name: Run gzexe
57+
node --experimental-sea-config sea-config.json
58+
node -e "require('fs').copyFileSync(process.execPath, '${{ matrix.artifact_name }}')"
59+
npx postject ${{ matrix.artifact_name }} NODE_SEA_BLOB sea-prep.blob --overwrite --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
60+
- name: Create Linux binaries
61+
if: matrix.os == 'ubuntu-latest'
5662
run: |
57-
gzexe astgen-linux
58-
gzexe astgen-linux-arm
59-
- name: Make executable
63+
node --experimental-sea-config sea-config.json
64+
cp $(command -v node) ${{ matrix.artifact_name }}
65+
npx postject ${{ matrix.artifact_name }} NODE_SEA_BLOB sea-prep.blob --overwrite --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
66+
- name: Create MacOS binaries
67+
if: matrix.os == 'macos-latest'
6068
run: |
61-
chmod +x astgen-macos
62-
chmod +x astgen-macos-arm
63-
chmod +x astgen-linux
64-
chmod +x astgen-linux-arm
69+
node --experimental-sea-config sea-config.json
70+
cp $(command -v node) ${{ matrix.artifact_name }}
71+
codesign --remove-signature ${{ matrix.artifact_name }}
72+
npx postject ${{ matrix.artifact_name }} NODE_SEA_BLOB sea-prep.blob --overwrite --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 --macho-segment-name NODE_SEA
73+
codesign --sign - ${{ matrix.artifact_name }}
6574
- name: Set next release version
6675
id: taggerFinal
6776
uses: anothrNick/[email protected]
6877
env:
6978
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7079
WITH_V: true
71-
- name: Release
72-
uses: softprops/action-gh-release@v1
80+
- name: Upload binaries to release
81+
uses: svenstaro/upload-release-action@v2
7382
with:
74-
tag_name: ${{ steps.taggerDryRun.outputs.new_tag }}
75-
files: |
76-
astgen-win.exe
77-
astgen-macos
78-
astgen-macos-arm
79-
astgen-linux
80-
astgen-linux-arm
83+
repo_token: ${{ secrets.GITHUB_TOKEN }}
84+
file: ${{ matrix.artifact_name }}
85+
asset_name: ${{ matrix.artifact_name }}
86+
tag: ${{ steps.taggerDryRun.outputs.new_tag }}

0 commit comments

Comments
 (0)