@@ -2,12 +2,12 @@ name: Release
2
2
3
3
on :
4
4
push :
5
- branches : [ "main" ]
6
- pull_request :
7
- branches : [ "main" ]
5
+ tags :
6
+ - " v*.*.*"
8
7
9
8
env :
10
9
CARGO_TERM_COLOR : always
10
+ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER : aarch64-linux-gnu-gcc
11
11
MACOSX_DEPLOYMENT_TARGET : ' 10.13'
12
12
13
13
jobs :
@@ -17,14 +17,15 @@ jobs:
17
17
18
18
strategy :
19
19
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
28
29
29
30
steps :
30
31
- name : Checkout
@@ -39,11 +40,43 @@ jobs:
39
40
with :
40
41
key : ${{ matrix.target }}
41
42
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'
44
45
run : |
45
46
sudo apt-get update
46
- sudo apt-get install -y libgtk-3-dev
47
+ sudo apt-get install -y gcc-aarch64-linux-gnu
47
48
48
49
- 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