Update release.yml #13
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Release ZScript | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| # This block is what makes it work without manual settings changes | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # ---------- LINUX X64 ---------- | |
| - os: ubuntu-latest | |
| name: linux-x64-avx2 | |
| target: bun-linux-x64 | |
| - os: ubuntu-latest | |
| name: linux-x64-baseline | |
| target: bun-linux-x64-baseline | |
| # ---------- LINUX MUSL (Alpine) ---------- | |
| - os: ubuntu-latest | |
| name: linux-x64-musl-avx2 | |
| target: bun-linux-x64-musl | |
| - os: ubuntu-latest | |
| name: linux-x64-musl-baseline | |
| target: bun-linux-x64-musl-baseline | |
| # ---------- LINUX ARM64 ---------- | |
| - os: ubuntu-latest | |
| name: linux-arm64 | |
| target: bun-linux-arm64 | |
| # ---------- WINDOWS X64 ---------- | |
| - os: ubuntu-latest | |
| name: windows-x64-avx2 | |
| target: bun-windows-x64 | |
| - os: ubuntu-latest | |
| name: windows-x64-baseline | |
| target: bun-windows-x64-baseline | |
| # ---------- MACOS ---------- | |
| - os: macos-latest | |
| name: macos-x64-avx2 | |
| target: bun-darwin-x64 | |
| - os: macos-latest | |
| name: macos-x64-baseline | |
| target: bun-darwin-x64-baseline | |
| - 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: 1.3.6 | |
| - name: Install dependencies | |
| working-directory: src/compiler | |
| run: bun install | |
| - name: Build binary | |
| working-directory: src/compiler | |
| shell: bash | |
| run: | | |
| mkdir -p dist | |
| # Determine output name (zsc or zsc.exe) | |
| if [[ "${{ matrix.target }}" == *"windows"* ]]; then | |
| OUTFILE="dist/zsc.exe" | |
| else | |
| OUTFILE="dist/zsc" | |
| fi | |
| bun build zsc.js \ | |
| --bundle \ | |
| --compile \ | |
| --target=${{ matrix.target }} \ | |
| --outfile "$OUTFILE" | |
| - name: Package Assets | |
| working-directory: src/compiler/dist | |
| shell: bash | |
| run: | | |
| if [[ "${{ matrix.target }}" == *"windows"* ]]; then | |
| # File inside is zsc.exe, Zip name is unique per platform | |
| zip zsc-${{ matrix.name }}.zip zsc.exe | |
| else | |
| chmod +x zsc | |
| tar -czf zsc-${{ matrix.name }}.tar.gz zsc | |
| fi | |
| - name: Upload Release Assets | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| # This ensures it picks up the files from the correct new directory | |
| files: | | |
| src/compiler/dist/*.zip | |
| src/compiler/dist/*.tar.gz |