From c2cbed10a373d691a42dae75b921e45d1c621ea5 Mon Sep 17 00:00:00 2001 From: justorez Date: Wed, 10 Jan 2024 20:51:08 +0800 Subject: [PATCH] workflow: fix release --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54ff51e..01a742c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: build +name: ci 'on': push: branches: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1340b3e..c0d8aa7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,16 +43,21 @@ jobs: - run: pnpm install - name: Get package version - id: get-version - run: echo "::set-output name=version::$(node -p "require('./package.json').version")" + id: version + uses: ashley-taylor/read-json-property-action@v1.0 + with: + path: ./package.json + property: version - - run: pnpm run build - - run: zip -r dist-v${{ steps.get-version.outputs.version }}.zip dist + - name: Build + run: | + pnpm run build + zip -r dist-v${{ steps.version.outputs.value }}.zip dist/* - name: Release uses: softprops/action-gh-release@v1 with: - tag_name: v${{ steps.get-version.outputs.version }} - name: v${{ steps.get-version.outputs.version }} + tag_name: v${{ steps.version.outputs.value }} + name: v${{ steps.version.outputs.value }} draft: true - files: dist-v${{ steps.get-version.outputs.version }}.zip + files: dist-v${{ steps.version.outputs.value }}.zip