Skip to content

Commit

Permalink
build(GitHub Actions): add CI workflow for building project on tag pu…
Browse files Browse the repository at this point in the history
…shes

- Introduced a GitHub Actions workflow to automate builds for multiple target platforms
- Supports aarch64 and x86_64 architectures for Windows, macOS, and Linux
- Automatically uploads built binaries to GitHub releases upon tagging
  • Loading branch information
darkyzhou committed Sep 17, 2024
1 parent c131436 commit 8024aae
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: build

on:
push:
tags:
- "*"

jobs:
build:
strategy:
matrix:
target:
[
aarch64-windows,
x86_64-windows,
aarch64-macos,
x86_64-macos,
aarch64-linux,
x86_64-linux,
]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0

- name: Build project
if: startsWith(github.ref, 'refs/tags/')
run: |
zig build -Doptimize=ReleaseSmall -Dtarget=${{ matrix.target }}
mv zig-out/bin/mcm zig-out/bin/mcm-${{ matrix.target }}-${{ github.ref_name }}
- name: Upload to release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: zig-out/bin/mcm-${{ matrix.target }}-${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 8024aae

Please sign in to comment.