Skip to content

Update build_and_release.yml #22

Update build_and_release.yml

Update build_and_release.yml #22

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: Set SDKROOT for macOS
if: matrix.os == 'macos-latest'
run: echo "export SDKROOT=$(xcrun --show-sdk-path)" >> $GITHUB_ENV
- 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 }}