Skip to content

.github/workflows: fix package and release #13

.github/workflows: fix package and release

.github/workflows: fix package and release #13

Workflow file for this run

name: Build Binary Executable
on:
push:
branches:
- master
tags:
- "v*.*.*"
pull_request:
jobs:
build-all:
strategy:
matrix:
target:
- "aarch64-apple-darwin"
- "x86_64-apple-darwin"
- "x86_64-unknown-linux-gnu"
- "aarch64-unknown-linux-gnu"
# - "x86_64-pc-windows-msvc"
name: Build For ${{ matrix.target }}
uses: ./.github/workflows/zigbuild.yml
with:
target: ${{ matrix.target }}
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: false
- name: compress
run: |
cd artifacts
for dir in */; do
dirname="${dir%/}"
if [[ $dirname == *"windows"* ]]; then
zip -r tng-${{ github.ref_name }}.${dirname}.zip tng.exe
else
tar czvf tng-${{ github.ref_name }}.${dirname}.tar.gz tng
fi
done
- name: List Directory
run: ls -R artifacts
- name: Upload Release
uses: softprops/action-gh-release@v2
with:
draft: false
fail_on_unmatched_files: true
prerelease: false
files: |
./artifacts/*.zip
./artifacts/*.tar.gz