Deploy release artifacts #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: master | |
# - 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 -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: echo "PROJECT_VERSION=$(zigscient/zigscient-x86_64-linux-gnu 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" |