Skip to content

Commit

Permalink
chore: update action script
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshenhai committed May 19, 2024
1 parent 3dc90b4 commit 0c1b3b4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,23 @@ jobs:
- run: pnpm i
- run: npm run test
- run: npm run build
- run: npm run version:reset-for-release
# - run: npm publish --provenance --access public -w ./packages/types --tag next
- run: pnpm publish --no-git-checks --provenance --access public -w ./packages/types
- run: npm publish --provenance --access public -w ./packages/types
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm publish --no-git-checks --provenance --access public -w ./packages/util
- run: npm publish --provenance --access public -w ./packages/util
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm publish --no-git-checks --provenance --access public -w ./packages/renderer
- run: npm publish --provenance --access public -w ./packages/renderer
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm publish --no-git-checks --provenance --access public -w ./packages/board
- run: npm publish --provenance --access public -w ./packages/board
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm publish --no-git-checks --provenance --access public -w ./packages/core
- run: npm publish --provenance --access public -w ./packages/core
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm publish --no-git-checks --provenance --access public -w ./packages/idraw
- run: npm publish --provenance --access public -w ./packages/idraw
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
"precommit": "npm run lint",
"prepush": "npm run lint",
"clear:jest": "rm -rf ./packages/*/__tests__/__snapshots__",
"upgrade:version": "ts-node --project ./tsconfig.node.json ./scripts/upgrade-version.ts && pnpm i"
"version:reset": "ts-node --project ./tsconfig.node.json ./scripts/upgrade-version.ts",
"version:reset-for-release": "ts-node --project ./tsconfig.node.json ./scripts/upgrade-version.ts --for-release",
"upgrade:version": "version:reset && pnpm i"
},
"devDependencies": {
"@babel/core": "^7.24.4",
Expand Down
6 changes: 5 additions & 1 deletion scripts/upgrade-version.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import process from 'node:process';
import { readJSONFile, writeJSONFile } from './util/file';
import { getRootPackageJSON, getAllSubPackageDirs } from './util/project';
const pkg = getRootPackageJSON();
const version = pkg.version;

const workspacePrefix = 'workspace:';
let workspacePrefix = 'workspace:';
if (process.argv[2] === '--for-release') {
workspacePrefix = '';
}

async function run(): Promise<void> {
const pkgDirs = getAllSubPackageDirs();
Expand Down

0 comments on commit 0c1b3b4

Please sign in to comment.