fix error #23
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Build & Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Cache Zig compiler installations | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.local/share/zig | |
| key: ${{ runner.os }}-zig-0.16.0 | |
| - name: Install zigup and Zig 0.16.0 | |
| run: | | |
| mkdir -p "$HOME/.local/bin" | |
| curl -sSfL https://raw.githubusercontent.com/Satheeshsk369/zigup/main/install.sh | sh | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| export PATH="$HOME/.local/bin:$PATH" | |
| zigup install 0.16.0 | |
| zigup default 0.16.0 | |
| shell: bash | |
| - name: Cross-Compile Binaries | |
| run: | | |
| mkdir -p dist | |
| # Linux Targets | |
| for arch in x86 x86_64 aarch64; do | |
| echo "Building Linux $arch..." | |
| zig build -Doptimize=ReleaseFast -Dtarget=$arch-linux | |
| cp zig-out/bin/zigup dist/zigup-$arch-linux | |
| done | |
| # macOS Targets (No 32-bit x86 support on macOS) | |
| for arch in x86_64 aarch64; do | |
| echo "Building macOS $arch..." | |
| zig build -Doptimize=ReleaseFast -Dtarget=$arch-macos | |
| cp zig-out/bin/zigup dist/zigup-$arch-macos | |
| done | |
| for arch in x86 x86_64 aarch64; do | |
| echo "Building Windows $arch..." | |
| zig build -Doptimize=ReleaseFast -Dtarget=$arch-windows | |
| cp zig-out/bin/zigup.exe dist/zigup-$arch-windows.exe | |
| done | |
| shell: bash | |
| - name: Create Release and Upload Assets | |
| uses: softprops/action-gh-release@v2.2.1 | |
| with: | |
| files: dist/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |