Update build_and_release.yml #20
This file contains 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: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: 0.12.0 | |
- run: zig fmt --check . | |
build: | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest] #, ubuntu-latest] | |
include: | |
# - os: ubuntu-latest | |
# target: x86_64-linux | |
- os: macos-latest | |
target: aarch64-macos-none | |
- os: windows-latest | |
target: x86_64-windows | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: goto-bus-stop/setup-zig@v2 | |
name: Setup zig | |
with: | |
version: 0.12.0 | |
- name: Install dependencies (Ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-dev libx11-dev libgtk-4-dev build-essential | |
- name: Install dependencies (MacOS) | |
if: matrix.os == 'macos-latest' | |
run: xcode-select --install | |
- name: Get universal dependencies | |
run: zig fetch --save https://github.com/Not-Nik/raylib-zig/archive/devel.tar.gz | |
- name: Build binary | |
run: zig build -Doptimize=ReleaseSafe -Dtarget=${{ matrix.target }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
zig-out/bin/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |