Skip to content

Commit

Permalink
chore: release
Browse files Browse the repository at this point in the history
  • Loading branch information
callqh committed Apr 11, 2024
1 parent c33c784 commit 125506e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"scripts": {
"build": "farm-plugin-tools build --platform --cargo-name farm_plugin_remove_console -p farm_plugin_remove_console --release",
"bump": "npx changeset version",
"release": "npm config set access public && npx changeset publish",
"release": "node ./scripts/release.mjs",
"prepublishOnly": "farm-plugin-tools prepublish"
},
"files": [
Expand Down
12 changes: 12 additions & 0 deletions scripts/release.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {execSync} from 'child_process';

const npmToken = process.env.NODE_AUTH_TOKEN;

if (!npmToken) {
console.error('NPM_TOKEN 环境变量未设置!');
process.exit(1);
}

// 为 npm 设置 auth token
execSync(`npm set //registry.npmjs.org/:_authToken=${npmToken}`);
execSync(`npx changeset publish`);

0 comments on commit 125506e

Please sign in to comment.