From 4953c58fdbb4e67db172ae7ca0c4b51651030a86 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Sat, 15 Jun 2024 11:25:33 +0530 Subject: [PATCH] fix token, add upload source --- .github/workflows/release.yml | 36 ++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 77787b5..218fd13 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,10 @@ name: Release on: - workflow_dispatch: push: tags: + - v*.*.* + workflow_dispatch: jobs: upload-binaries: @@ -22,8 +23,9 @@ jobs: with: version: 0.12.0 - - name: Print Zig meta + - name: Print meta run: | + echo $GITHUB_REF_NAME zig version zig env @@ -76,7 +78,7 @@ jobs: overwrite: true tag: ${{ github.ref }} release_name: 'Release v${{ env.RELEASE_VERSION }}' - repo_token: ${{ secrets.GITHUB_TOKEN }} + repo_token: ${{ secrets.RELEASE_TOKEN }} draft: true # Upload artifacts to GHA for inspection incase something @@ -89,3 +91,31 @@ jobs: retention-days: 3 overwrite: true if-no-files-found: error + + upload-source: + name: Upload Source + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v4 + + - name: Set release version + run: echo "RELEASE_VERSION=$GITHUB_REF_NAME" >> $GITHUB_ENV + + - name: Prepare source code + run: | + cd .. + zip -r v${{ env.RELEASE_VERSION }}.zip ${{ github.event.repository.name }} + tar -czvf v${{ env.RELEASE_VERSION }}.tar.gz ${{ github.event.repository.name }} + mv v${{ env.RELEASE_VERSION }}* ${{ github.event.repository.name }} + + - name: Upload for release + uses: svenstaro/upload-release-action@v2 + with: + file: v${{ env.RELEASE_VERSION }}* + file_glob: true + overwrite: true + tag: ${{ github.ref }} + release_name: 'Release v${{ env.RELEASE_VERSION }}' + repo_token: ${{ secrets.RELEASE_TOKEN }} + draft: true