Skip to content

feat: add new binary zigfetch #17

feat: add new binary zigfetch

feat: add new binary zigfetch #17

Workflow file for this run

name: Release
on:
workflow_dispatch:
pull_request:
paths:
- "**.zig"
- ".github/workflows/CI.yml"
- ".github/workflows/release.yml"
push:
branches:
- main
paths:
- "**.zig"
- ".github/workflows/release.yml"
tags:
- "v*"
permissions:
contents: write
jobs:
upload-assets:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: mlugg/setup-zig@v1
with:
version: 0.13.0
- name: Set env
run: |
echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
echo "OUT_DIR=/tmp/zigcli" >> $GITHUB_ENV
- name: Build(Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
bash .github/build-release.sh
- name: Build(MacOS)
if: matrix.os == 'macos-latest'
run: |
mkdir -p "${OUT_DIR}"
zig build -Doptimize=ReleaseSafe \
-Dgit_commit=${GIT_COMMIT} -Dbuild_date=${BUILD_DATE}
rm -f zig-out/bin/*demo
cp LICENSE README.org zig-out
pushd zig-out
zip -r ${OUT_DIR}/zigcli-${RELEASE_VERSION}-aarch64-macos.zip .
popd
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ env.OUT_DIR }}/*