From 13ba015e559a32833e6ca72c039510e3284da298 Mon Sep 17 00:00:00 2001 From: Seedgou Date: Tue, 31 Dec 2024 10:38:22 +0800 Subject: [PATCH] ci: add upload-release job to CI workflow for handling release artifacts --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1697b37..8fa12bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -245,3 +245,25 @@ jobs: - run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + + upload-release: + needs: build + runs-on: ubuntu-latest + if: github.event_name == 'release' + permissions: + contents: write + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: dist + path: dist + + - name: Zip dist directory + run: zip -r dist.zip dist + + - name: Upload Release Asset + uses: svenstaro/upload-release-action@v2 + with: + file: dist.zip + overwrite: true