Build flow

This commit is contained in:
Ben Sarmiento
2023-11-21 16:06:59 +01:00
parent 4a053f42a0
commit c22206800c
2 changed files with 8 additions and 45 deletions

View File

@@ -1,6 +1,9 @@
name: Build and Release
on: push
on:
push:
tags:
- '*'
jobs:
build:
@@ -34,15 +37,15 @@ jobs:
- name: Compress artifacts
run: |
mkdir -p compressed_artifacts
for platform in windows/amd64 linux/amd64 linux/arm64 darwin/arm64; do
tar -czvf "compressed_artifacts/zurg-$platform-${{ github.run_number }}-${{ github.sha }}.tar.gz" -C artifacts ./zurg-$platform*
for platform in windows-amd64.exe linux-amd64 linux-arm64 darwin-arm64; do
zip -r "compressed_artifacts/zurg-$platform-${{ github.ref }}.zip" "artifacts/zurg-$platform"
done
- name: Upload artifacts to workflow
uses: actions/upload-artifact@v3
with:
name: compiled-binaries
path: compressed_artifacts/*.tar.gz
path: compressed_artifacts/*.zip
release:
needs: build
@@ -69,7 +72,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for platform in windows/amd64 linux/amd64 linux/arm64 darwin/arm64; do
asset_path="./compressed_artifacts/zurg-$platform-${{ github.run_number }}-${{ github.sha }}.tar.gz"
asset_path="./compressed_artifacts/zurg-$platform-${{ github.ref }}.zip"
if [[ -f "$asset_path" ]]; then
echo "Uploading $asset_path"
gh release upload ${{ github.ref }} "$asset_path" --c ${{ secrets.GITHUB_TOKEN }}