@@ -2,12 +2,12 @@ name: Release
22
33on :
44 push :
5- branches : [ "main" ]
6- pull_request :
7- branches : [ "main" ]
5+ tags :
6+ - " v*.*.*"
87
98env :
109 CARGO_TERM_COLOR : always
10+ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER : aarch64-linux-gnu-gcc
1111 MACOSX_DEPLOYMENT_TARGET : ' 10.13'
1212
1313jobs :
@@ -17,14 +17,15 @@ jobs:
1717
1818 strategy :
1919 matrix :
20- - os : macos-latest
21- target : aarch64-apple-darwin
22- - os : macos-latest
23- target : x86_64-apple-darwin
24- - os : ubuntu-latest
25- target : aarch64-unknown-linux-gnu
26- - os : ubuntu-latest
27- target : x86_64-unknown-linux-gnu
20+ include :
21+ - os : macos-latest
22+ target : aarch64-apple-darwin
23+ - os : macos-latest
24+ target : x86_64-apple-darwin
25+ - os : ubuntu-latest
26+ target : aarch64-unknown-linux-gnu
27+ - os : ubuntu-latest
28+ target : x86_64-unknown-linux-gnu
2829
2930 steps :
3031 - name : Checkout
@@ -39,11 +40,43 @@ jobs:
3940 with :
4041 key : ${{ matrix.target }}
4142
42- - name : Install Linux dependencies
43- if : matrix.os == 'ubuntu-latest'
43+ - name : Install gcc-aarch64-linux-gnu
44+ if : matrix.os == 'ubuntu-latest' && matrix.target == 'aarch64-unknown-linux-gnu'
4445 run : |
4546 sudo apt-get update
46- sudo apt-get install -y libgtk-3-dev
47+ sudo apt-get install -y gcc-aarch64-linux-gnu
4748
4849 - name : Build
49- run : cargo build --release --target ${{ matrix.target }}
50+ run : cargo build -p native --release --target ${{ matrix.target }}
51+
52+ - name : Move Build
53+ run : mv target/${{ matrix.target }}/release/native cjs-module-lexer-${{ matrix.target }}
54+
55+ - name : Upload Artifact
56+ uses : actions/upload-artifact@v4
57+ with :
58+ name : cjs-module-lexer-${{ matrix.target }}
59+ path : cjs-module-lexer-${{ matrix.target }}
60+ if-no-files-found : error
61+
62+ release :
63+ needs : build
64+ runs-on : ubuntu-latest
65+
66+ steps :
67+ - name : Checkout
68+ uses : actions/checkout@v4
69+
70+ - name : Download artifact
71+ uses : actions/download-artifact@v4
72+ with :
73+ merge-multiple : true
74+ path : .artifact
75+
76+ - name : Gzip Artifact
77+ run : gzip .artifact/*
78+
79+ - name : Publish release
80+ uses : softprops/action-gh-release@v2
81+ with :
82+ files : .artifact/cjs-module-lexer-*.gz
0 commit comments