Skip to content

Commit

Permalink
feat: update release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
shaobeichen committed Nov 1, 2024
1 parent 040e98d commit de99cf4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ jobs:
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
10 changes: 0 additions & 10 deletions scripts/release.js
Original file line number Diff line number Diff line change
@@ -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' })

Expand Down

0 comments on commit de99cf4

Please sign in to comment.