From 37bd60134aedc3be8216ce5e06e6f128bf713343 Mon Sep 17 00:00:00 2001 From: icodesign Date: Sun, 21 Jul 2024 11:39:02 +0800 Subject: [PATCH] Update release workflow --- .github/workflows/release-package.yml | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml index 065c86d..6ccb347 100644 --- a/.github/workflows/release-package.yml +++ b/.github/workflows/release-package.yml @@ -1,15 +1,14 @@ name: Release Package on: - workflow_dispatch: - secrets: - NPM_TOKEN: - required: true + push: + branches: + - main + env: CI: true - PNPM_CACHE_FOLDER: .pnpm-store jobs: - version: + release: timeout-minutes: 15 runs-on: ubuntu-latest steps: @@ -18,20 +17,21 @@ jobs: with: fetch-depth: 0 - - name: Setup node.js - uses: actions/setup-node@v3 + - uses: pnpm/action-setup@v4 + name: Install pnpm with: - node-version: 18 + version: 8 + run_install: false - - name: install pnpm - run: npm i pnpm@latest -g + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: 'pnpm' - name: Setup npmrc run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc - - name: Setup pnpm config - run: pnpm config set store-dir $PNPM_CACHE_FOLDER - - name: Install dependencies run: pnpm install