Skip to content

Deploy release artifacts #7

Deploy release artifacts

Deploy release artifacts #7

Workflow file for this run

name: Deploy release artifacts
on:
# push:
# branches:
# - dev
workflow_dispatch:
jobs:
build:
# if: github.repository_owner == 'llogick' && github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required to resolve the version string
- uses: mlugg/setup-zig@v1
with:
version: 0.14.0
# - name: Install APT packages
# run: |
# sudo apt-get update
# sudo apt-get install tar 7zip
# - name: Install minisign
# run: |
# wget https://github.com/jedisct1/minisign/releases/download/0.11/minisign-0.11-linux.tar.gz
# tar -xf minisign-0.11-linux.tar.gz --directory ${HOME}
# echo "${HOME}/minisign-linux/x86_64/" >> $GITHUB_PATH
- name: Build all targets
run: |
mkdir -p builds
for target in "x86_64-linux" "aarch64-linux" "x86_64-windows" "aarch64-windows" "x86_64-macos" "aarch64-macos"; do
zig build -Dcpu=baseline -Dtarget=${target} -Doptimize=ReleaseFast
if [[ $target == *"windows"* ]]; then
cp zig-out/bin/zigscient.exe builds/zigscient-${target}.exe
else
cp zig-out/bin/zigscient builds/zigscient-${target}
fi
done
- uses: actions/upload-artifact@v4
with:
name: zigscient
path: builds/
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: zigscient
path: zigscient
- name: Get project version
run: |
chmod +x zigscient/zigscient-x86_64-linux
echo "PROJECT_VERSION=$(zigscient/zigscient-x86_64-linux version)" >> $GITHUB_ENV
- name: Create zips
run: |
cd zigscient
for file in *; do
zip -j "../${file%.*}.zip" "$file"
done
- uses: softprops/action-gh-release@v2
with:
name: ${{ env.PROJECT_VERSION }}
tag_name: ${{ env.PROJECT_VERSION }}
draft: true
make_latest: true
files: "*.zip"