Compare commits
1
Commits
main
...
b8110d4c6a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8110d4c6a
|
@@ -1,11 +1,19 @@
|
|||||||
name: Build and Release
|
name: Build and Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -14,13 +22,16 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: Build executables
|
name: Build executables
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
ZIG_LOCAL_CACHE_DIR: /ci-cache/zig-chess/0.16.0/linux-amd64/local
|
||||||
|
ZIG_GLOBAL_CACHE_DIR: /ci-cache/zig-chess/0.16.0/linux-amd64/global
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Zig
|
- name: Set up Zig
|
||||||
uses: mlugg/setup-zig@v2
|
uses: https://github.com/mlugg/setup-zig@v2
|
||||||
with:
|
with:
|
||||||
version: 0.16.0
|
version: 0.16.0
|
||||||
|
|
||||||
@@ -34,17 +45,21 @@ jobs:
|
|||||||
zig version
|
zig version
|
||||||
glslc --version
|
glslc --version
|
||||||
|
|
||||||
|
- name: Prepare persistent Zig caches
|
||||||
|
run: |
|
||||||
|
mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR"
|
||||||
|
|
||||||
- name: Build GUI executable
|
- name: Build GUI executable
|
||||||
run: |
|
run: |
|
||||||
zig build \
|
zig build \
|
||||||
--cache-dir /tmp/zig-chess-cache \
|
--cache-dir "$ZIG_LOCAL_CACHE_DIR" \
|
||||||
--global-cache-dir /tmp/zig-global-cache
|
--global-cache-dir "$ZIG_GLOBAL_CACHE_DIR"
|
||||||
|
|
||||||
- name: Build magic generator executable
|
- name: Build magic generator executable
|
||||||
run: |
|
run: |
|
||||||
zig build magic-numbers \
|
zig build magic-numbers \
|
||||||
--cache-dir /tmp/zig-chess-cache \
|
--cache-dir "$ZIG_LOCAL_CACHE_DIR" \
|
||||||
--global-cache-dir /tmp/zig-global-cache
|
--global-cache-dir "$ZIG_GLOBAL_CACHE_DIR"
|
||||||
|
|
||||||
- name: Package executables
|
- name: Package executables
|
||||||
run: |
|
run: |
|
||||||
@@ -60,7 +75,7 @@ jobs:
|
|||||||
sha256sum "dist/${artifact_dir}.tar.gz" > "dist/${artifact_dir}.tar.gz.sha256"
|
sha256sum "dist/${artifact_dir}.tar.gz" > "dist/${artifact_dir}.tar.gz.sha256"
|
||||||
|
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: https://github.com/actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: zig-chess-${{ github.ref_name }}
|
name: zig-chess-${{ github.ref_name }}
|
||||||
path: |
|
path: |
|
||||||
|
|||||||
Reference in New Issue
Block a user