Build flow
This commit is contained in:
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user