Skip to content

Commit 10d41d4

Browse files
authored
Update release.yml
1 parent 3631d94 commit 10d41d4

File tree

1 file changed

+46
-37
lines changed

1 file changed

+46
-37
lines changed

.github/workflows/release.yml

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,55 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
include:
17-
# ---------- LINUX ----------
17+
# ---------- LINUX X64 ----------
1818
- os: ubuntu-latest
19-
name: linux-x64
19+
name: linux-x64-avx2
2020
target: bun-linux-x64
21-
# We add a 'variant' field to control output naming
22-
variant: ""
21+
variant: "-avx2"
22+
23+
- os: ubuntu-latest
24+
name: linux-x64-baseline
25+
target: bun-linux-x64-baseline
26+
variant: "-baseline"
2327

28+
# ---------- LINUX MUSL (Alpine) ----------
2429
- os: ubuntu-latest
25-
name: linux-x64-musl
30+
name: linux-x64-musl-avx2
2631
target: bun-linux-x64-musl
27-
variant: "-musl"
32+
variant: "-musl-avx2"
2833

34+
- os: ubuntu-latest
35+
name: linux-x64-musl-baseline
36+
target: bun-linux-x64-musl-baseline
37+
variant: "-musl-baseline"
38+
39+
# ---------- LINUX ARM64 ----------
2940
- os: ubuntu-latest
3041
name: linux-arm64
3142
target: bun-linux-arm64
3243
variant: ""
3344

34-
- os: ubuntu-latest
35-
name: linux-arm64-musl
36-
target: bun-linux-arm64-musl
37-
variant: "-musl"
38-
39-
# ---------- WINDOWS (AVX2 and BASELINE VARIANTS ADDED) ----------
40-
- os: windows-latest
45+
# ---------- WINDOWS X64 ----------
46+
- os: ubuntu-latest # Using Linux to cross-compile Windows prevents extraction errors
4147
name: windows-x64-avx2
4248
target: bun-windows-x64
4349
variant: "-avx2"
4450

45-
- os: windows-latest
51+
- os: ubuntu-latest
4652
name: windows-x64-baseline
4753
target: bun-windows-x64-baseline
4854
variant: "-baseline"
4955

5056
# ---------- MACOS ----------
5157
- os: macos-latest
52-
name: macos-x64
58+
name: macos-x64-avx2
5359
target: bun-darwin-x64
54-
variant: ""
60+
variant: "-avx2"
61+
62+
- os: macos-latest
63+
name: macos-x64-baseline
64+
target: bun-darwin-x64-baseline
65+
variant: "-baseline"
5566

5667
- os: macos-latest
5768
name: macos-arm64
@@ -65,7 +76,7 @@ jobs:
6576

6677
- uses: oven-sh/setup-bun@v1
6778
with:
68-
bun-version: latest
79+
bun-version: 1.3.6 # Fixed to the version you specified
6980

7081
- name: Install dependencies
7182
working-directory: compiler
@@ -77,35 +88,33 @@ jobs:
7788
shell: bash
7889
run: |
7990
mkdir -p dist
80-
# We use a dynamic filename based on the matrix name/variant
81-
# In Windows, bun automatically adds the .exe extension if the target is windows
91+
# Bun automatically adds .exe when target is windows
8292
bun build zsc.js \
93+
--bundle \
8394
--compile \
8495
--target=${{ matrix.target }} \
8596
--outfile dist/zsc${{ matrix.variant }}
8697
87-
# -------- Linux & macOS --------
88-
- name: Package tar.gz
89-
if: runner.os != 'Windows'
98+
# -------- Packaging Logic --------
99+
- name: Package Assets
90100
working-directory: compiler/dist
91101
shell: bash
92102
run: |
93-
# Use the dynamic filename created above for packaging
94-
BIN_NAME="zsc${{ matrix.variant }}"
95-
chmod +x $BIN_NAME
96-
tar -czf zsc-${{ matrix.name }}.tar.gz $BIN_NAME
97-
98-
# -------- Windows --------
99-
- name: Package zip (Windows)
100-
if: runner.os == 'Windows'
101-
working-directory: compiler/dist
102-
shell: pwsh
103-
run: |
104-
# Use the dynamic filename created above (with auto .exe extension) for zipping
105-
$BIN_NAME = "zsc${{ matrix.variant }}.exe"
106-
Compress-Archive $BIN_NAME zsc-${{ matrix.name }}.zip
103+
# Determine if the target was windows to find the right file
104+
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
105+
FILENAME="zsc${{ matrix.variant }}.exe"
106+
# Use zip for Windows
107+
zip zsc-${{ matrix.name }}.zip "$FILENAME"
108+
else
109+
FILENAME="zsc${{ matrix.variant }}"
110+
chmod +x "$FILENAME"
111+
# Use tar.gz for Linux/macOS
112+
tar -czf zsc-${{ matrix.name }}.tar.gz "$FILENAME"
113+
fi
107114
108115
- name: Upload Release Assets
109116
uses: softprops/action-gh-release@v1
110117
with:
111-
files: compiler/dist/zsc-${{ matrix.name }}.*
118+
files: |
119+
compiler/dist/*.zip
120+
compiler/dist/*.tar.gz

0 commit comments

Comments
 (0)