Skip to content

Commit 96a51a1

Browse files
committed
chore: release actions workflows
1 parent 25e908c commit 96a51a1

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
run: |
7575
yarn install --immutable
7676
yarn run init
77+
yarn run update-package -v ${{ github.event.inputs.version }}
7778
7879
- name: Setup .yarnrc.yml
7980
run: |
@@ -93,12 +94,12 @@ jobs:
9394
GH_TOKEN: ${{ env.GITHUB_TOKEN }}
9495
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9596

96-
# 非 main 分支发布时,需要更新 `manifest.json` 文件后提交
97+
# 非 main 分支发布时,需要提交各 package 里的 version 变更
9798
- name: Commit Files Before Push Release Branch
9899
if: github.event.ref != 'refs/heads/main' && github.event.inputs.release_branch == ''
99100
run: |
100101
git add -A
101-
git commit -m 'chore: update manifest.json to v${{github.event.inputs.version}}'
102+
git commit -m 'chore: update package version to v${{github.event.inputs.version}}'
102103
git push origin ${{ github.event.inputs.release_branch }}
103104
104105
# 非 main 分支发布时,自动推送代码到对应分支并打 Tag

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"clean": "rimraf packages/*/lib",
2929
"test": "jest --runInBand",
3030
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
31+
"update-package": "node script/utils/update-package",
3132
"release": "node scripts/release",
3233
"release:next": "node scripts/release --tag=next"
3334
},

scripts/utils/update-package.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
const path = require('path');
22
const fse = require('fs-extra');
3-
const { prompt, Separator } = require('inquirer');
4-
const chalk = require('chalk');
5-
const { invoke, exec } = require('./utils/utils');
3+
const { invoke } = require('./utils');
64
const args = require('minimist')(process.argv.slice(2));
7-
const { SEMVER_INC, getNewVersion, isValidVersion, isVersionGreat } = require('./utils/version');
8-
const currentVersion = require('../package.json').version;
9-
const opensumiVersion = require('../package.json').engines.opensumi;
10-
const signale = require('signale');
11-
const depsFileds = require('./deps-fileds');
5+
const depsFileds = require('../deps-fileds');
126

137
const packages = fse
148
.readdirSync(path.resolve(__dirname, '../../packages'), { withFileTypes: true })
159
.filter((dirent) => dirent.isDirectory())
1610
.map((dirent) => dirent.name);
1711

12+
function getPkgRoot(pkg) {
13+
return path.resolve(__dirname, '../../packages/' + pkg);
14+
}
15+
1816
invoke(async () => {
1917
const version = args.v || args.version;
2018

0 commit comments

Comments
 (0)