Skip to content

Commit 23c4026

Browse files
authored
Create release.yml
1 parent f862638 commit 23c4026

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

.github/workflows/release.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Build and Release ZScript
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
# ---------- LINUX ----------
18+
- os: ubuntu-latest
19+
name: linux-x64
20+
target: bun-linux-x64
21+
22+
- os: ubuntu-latest
23+
name: linux-x64-musl
24+
target: bun-linux-x64-musl
25+
26+
- os: ubuntu-latest
27+
name: linux-arm64
28+
target: bun-linux-arm64
29+
30+
- os: ubuntu-latest
31+
name: linux-arm64-musl
32+
target: bun-linux-arm64-musl
33+
34+
# ---------- WINDOWS ----------
35+
- os: windows-latest
36+
name: windows-x64
37+
target: bun-windows-x64
38+
39+
# ---------- MACOS ----------
40+
- os: macos-latest
41+
name: macos-x64
42+
target: bun-darwin-x64
43+
44+
- os: macos-latest
45+
name: macos-arm64
46+
target: bun-darwin-arm64
47+
48+
runs-on: ${{ matrix.os }}
49+
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- uses: oven-sh/setup-bun@v1
54+
with:
55+
bun-version: latest
56+
57+
- name: Install dependencies
58+
working-directory: compiler
59+
shell: bash
60+
run: bun install
61+
62+
- name: Build binary
63+
working-directory: compiler
64+
shell: bash
65+
run: |
66+
mkdir -p dist
67+
bun build zsc.js \
68+
--compile \
69+
--target=${{ matrix.target }} \
70+
--outfile dist/zsc
71+
72+
# -------- Linux & macOS --------
73+
- name: Package tar.gz
74+
if: runner.os != 'Windows'
75+
working-directory: compiler/dist
76+
shell: bash
77+
run: |
78+
chmod +x zsc
79+
tar -czf zsc-${{ matrix.name }}.tar.gz zsc
80+
81+
# -------- Windows --------
82+
- name: Package zip (Windows)
83+
if: runner.os == 'Windows'
84+
working-directory: compiler/dist
85+
shell: pwsh
86+
run: |
87+
Compress-Archive zsc.exe zsc-${{ matrix.name }}.zip
88+
89+
- name: Upload Release Assets
90+
uses: softprops/action-gh-release@v1
91+
with:
92+
files: compiler/dist/zsc-${{ matrix.name }}.*

0 commit comments

Comments
 (0)