Skip to content

Commit a403acf

Browse files
authored
Merge pull request #2 from esm-dev/release-action
2 parents ba1c4cd + 4945c3b commit a403acf

File tree

2 files changed

+50
-17
lines changed

2 files changed

+50
-17
lines changed

.github/workflows/release.yml

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: Release
22

33
on:
44
push:
5-
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
5+
tags:
6+
- "v*.*.*"
87

98
env:
109
CARGO_TERM_COLOR: always
10+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
1111
MACOSX_DEPLOYMENT_TARGET: '10.13'
1212

1313
jobs:
@@ -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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ members = ["native", "lexer", "wasm"]
33
resolver = "2"
44

55
[profile.release.package.cjs-module-lexer]
6+
# optimization for size (more aggressive)
67
opt-level = "z"
78

89
[profile.release]
@@ -14,7 +15,6 @@ panic = "abort"
1415
strip = "symbols"
1516
# optimization over all codebase (better optimization, slower build)
1617
codegen-units = 1
17-
# optimization for size
18-
# opt-level = 's'
1918
# link time optimization using using whole-program analysis
2019
lto = true
20+
incremental = false

0 commit comments

Comments
 (0)