From f2a912693f856fc203155bcfaec2439d1aec77e3 Mon Sep 17 00:00:00 2001 From: changjun <52chinaweb@gmail.com> Date: Thu, 10 Aug 2023 10:14:41 +0800 Subject: [PATCH] chore(action): add upload release action --- .github/workflows/ release.yml | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/ release.yml b/.github/workflows/ release.yml index 82047a8..519085b 100644 --- a/.github/workflows/ release.yml +++ b/.github/workflows/ release.yml @@ -19,7 +19,43 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16.x + + - uses: pnpm/action-setup@v2 + name: Install pnpm + id: pnpm-install + with: + version: 7 + run_install: false + + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - name: build + run: pnpm run build - run: npx changelogithub env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - name: Upload files to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: dist/* + tag: ${{ github.ref }} + overwrite: true + file_glob: true