Skip to content

Create main.yml

Create main.yml #2

Workflow file for this run

name: Build and Release ZScript
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# ---------- LINUX ----------
- os: ubuntu-latest
name: linux-x64
target: bun-linux-x64
- os: ubuntu-latest
name: linux-x64-musl
target: bun-linux-x64-musl
- os: ubuntu-latest
name: linux-arm64
target: bun-linux-arm64
- os: ubuntu-latest
name: linux-arm64-musl
target: bun-linux-arm64-musl
# ---------- WINDOWS ----------
- os: windows-latest
name: windows-x64
target: bun-windows-x64
# ---------- MACOS ----------
- os: macos-latest
name: macos-x64
target: bun-darwin-x64
- os: macos-latest
name: macos-arm64
target: bun-darwin-arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
working-directory: compiler
shell: bash
run: bun install
- name: Build binary
working-directory: compiler
shell: bash
run: |
mkdir -p dist
bun build zsc.js \
--compile \
--target=${{ matrix.target }} \
--outfile dist/zsc
# -------- Linux & macOS --------
- name: Package tar.gz
if: runner.os != 'Windows'
working-directory: compiler/dist
shell: bash
run: |
chmod +x zsc
tar -czf zsc-${{ matrix.name }}.tar.gz zsc
# -------- Windows --------
- name: Package zip (Windows)
if: runner.os == 'Windows'
working-directory: compiler/dist
shell: pwsh
run: |
Rename-Item zsc zsc.exe
Compress-Archive zsc.exe zsc-${{ matrix.name }}.zip
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
with:
files: compiler/dist/zsc-${{ matrix.name }}.*