Skip to content

Merge branch 'chore/zig-0.16-migration' #2

Merge branch 'chore/zig-0.16-migration'

Merge branch 'chore/zig-0.16-migration' #2

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
workflow_call:
jobs:
build-release:
name: Build Release (${{ matrix.os }}, ${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-linux
artifact: zigeth-linux-x86_64.tar.gz
- os: ubuntu-latest
target: aarch64-linux
artifact: zigeth-linux-aarch64.tar.gz
- os: macos-latest
target: x86_64-macos
artifact: zigeth-macos-x86_64.tar.gz
- os: macos-latest
target: aarch64-macos
artifact: zigeth-macos-aarch64.tar.gz
- os: windows-latest
target: x86_64-windows
artifact: zigeth-windows-x86_64.zip
env:
ZIG_GLOBAL_CACHE_DIR: ${{ github.workspace }}/.zig-cache/global
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.15.2
cache: false
- name: Create cache directories (Unix)
if: runner.os != 'Windows'
run: mkdir -p .zig-cache/global
- name: Create cache directories (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: New-Item -Path ".zig-cache/global" -ItemType Directory -Force
- name: Build Release
run: zig build -Doptimize=ReleaseFast
- name: Create Archive (Unix)
if: runner.os != 'Windows'
run: |
cd zig-out
tar czf ../${{ matrix.artifact }} *
- name: Create Archive (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd zig-out
Compress-Archive -Path * -DestinationPath ../${{ matrix.artifact }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
create-release:
name: Create Release
runs-on: ubuntu-latest
needs: build-release
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R artifacts/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}