From aa0088bbc909c1c7b4745673978802e3016fde13 Mon Sep 17 00:00:00 2001 From: molvqingtai Date: Sat, 28 Sep 2024 13:01:03 +0800 Subject: [PATCH] fix: release flow --- .github/workflows/cd.yml | 2 +- .releaserc.mjs | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 24c7264..a0dcb41 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -39,6 +39,6 @@ jobs: version: latest - run: pnpm install --ignore-scripts - run: pnpm wxt prepare - - run: pnpm semantic-release --debug + - run: pnpm semantic-release env: GH_TOKEN: ${{ secrets.WEB_CHAT_GITHUB_TOKEN }} diff --git a/.releaserc.mjs b/.releaserc.mjs index 66e7526..aac5d12 100644 --- a/.releaserc.mjs +++ b/.releaserc.mjs @@ -1,6 +1,8 @@ /** * @type {import('semantic-release').GlobalConfig} */ + +import { name } from 'package.json' export default { branches: ['master'], plugins: [ @@ -26,13 +28,13 @@ export default { [ '@semantic-release/exec', { - prepareCmd: 'cp .output/web-chat-${nextRelease.version}-chrome.zip .output/web-chat-chrome.zip' + prepareCmd: `cp .output/${name}-\${nextRelease.version}-chrome.zip .output/${name}-chrome.zip` } ], [ '@semantic-release/exec', { - prepareCmd: 'cp .output/web-chat-${nextRelease.version}-firefox.zip .output/web-chat-firefox.zip' + prepareCmd: `cp .output/${name}-\${nextRelease.version}-firefox.zip .output/${name}-firefox.zip` } ], [ @@ -40,10 +42,10 @@ export default { { assets: [ { - path: '.output/web-chat-chrome.zip' + path: `.output/${name}-chrome.zip` }, { - path: '.output/web-chat-firefox.zip' + path: `.output/${name}-firefox.zip` } ], labels: ['release']