diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dbb0d8e..40b2eca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,22 +8,39 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - name: Use Node.js uses: actions/setup-node@v3 with: - cache: 'pnpm' + node-version: 20 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ env.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 build + - name: Semantic Release - uses: cycjimmy/semantic-release-action@v3 - with: - extra_plugins: | - @semantic-release/git + run: pnpm semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 9c9b23d..82199f7 100644 --- a/package.json +++ b/package.json @@ -204,10 +204,26 @@ "eslint --fix" ] }, - "np": { - "message": "chore(release): %s", - "tag": "latest", - "branch": "main", - "anyBranch": false + "release": { + "branches": ["main"], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + [ + "@semantic-release/git", + { + "assets": [ + "package.json", + "package-lock.json", + "CHANGELOG.md", + "build" + ], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ], + "@semantic-release/npm", + "@semantic-release/github" + ] } + } diff --git a/release.config.js b/release.config.js deleted file mode 100644 index ddc6304..0000000 --- a/release.config.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - branches: ['main'], - plugins: [ - '@semantic-release/git', - { - assets: ['package.json'], - message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}', - }, - ], -}