diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml index 0353ae6..a5012d1 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/blank.yml @@ -31,4 +31,5 @@ jobs: - name: Release env: GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: npx semantic-release diff --git a/scripts/release.js b/scripts/release.js index 686ee7c..4e323ae 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -1,22 +1,12 @@ const path = require('path') const { execSync } = require('child_process') -// 获取 GITHUB_TOKEN -const githubToken = process.env.GITHUB_TOKEN -if (!githubToken) { - console.error('请设置 GITHUB_TOKEN 环境变量。') - return -} - try { // npm 文件夹路径 const npmDir = path.join(__dirname, 'npm') console.log(`正在发布 ${npmDir} 下的所有子模块...`) - // 设置 NPM_TOKEN - process.env.NPM_TOKEN = githubToken // 如果需要,调整此行 - // 执行 npm publish -r execSync(`npm publish -r ${npmDir}`, { stdio: 'inherit' })