From c22206800c380c013136e96a8e959dad36a21500 Mon Sep 17 00:00:00 2001 From: Ben Sarmiento Date: Tue, 21 Nov 2023 16:06:59 +0100 Subject: [PATCH] Build flow --- .github/workflows/build.yml | 13 ++++++----- .github/workflows/build.yml.bak | 40 --------------------------------- 2 files changed, 8 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/build.yml.bak diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e30f83..5c93013 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }} diff --git a/.github/workflows/build.yml.bak b/.github/workflows/build.yml.bak deleted file mode 100644 index 348ccc9..0000000 --- a/.github/workflows/build.yml.bak +++ /dev/null @@ -1,40 +0,0 @@ -name: build - -on: - push: - branches: [ '**' ] - pull_request: - branches: [ '**' ] - -jobs: - build: - strategy: - matrix: - platform: [ubuntu-latest] - go-version: [1.21.3] - name: Build - runs-on: ${{ matrix.platform }} - steps: - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - - - name: Checkout - uses: actions/checkout@v4 - - - name: Install dependencies - run: | - docker pull techknowlogick/xgo:latest - go install src.techknowlogick.com/xgo@latest - sudo apt install upx - - - name: Build - run: | - bash build.sh dev - - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: zurg - path: dist