fix: optimize workflow #6
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 Publish | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Zig | |
| uses: goto-bus-stop/setup-zig@v2 | |
| with: | |
| version: '0.14.0' | |
| - name: Build for x86_64-linux | |
| run: | | |
| zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux | |
| mkdir -p artifacts | |
| cp zig-out/bin/plscommit artifacts/plscommit-x86_64-linux | |
| - name: Build for x86_64-windows | |
| run: | | |
| zig build -Doptimize=ReleaseFast -Dtarget=x86_64-windows | |
| mkdir -p artifacts | |
| cp zig-out/bin/plscommit artifacts/plscommit-x86_64-windows.exe | |
| - name: Build for x86_64-macos | |
| run: | | |
| zig build -Doptimize=ReleaseFast -Dtarget=x86_64-macos | |
| mkdir -p artifacts | |
| cp zig-out/bin/plscommit artifacts/plscommit-x86_64-macos | |
| - name: Build for aarch64-macos | |
| run: | | |
| zig build -Doptimize=ReleaseFast -Dtarget=aarch64-macos | |
| mkdir -p artifacts | |
| cp zig-out/bin/plscommit artifacts/plscommit-aarch64-macos | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: plscommit-binaries | |
| path: artifacts/ |