chore: release workflow

This commit is contained in:
fangsmile 2023-06-16 14:53:00 +08:00
parent 0cc8a0b146
commit 87aa8e6c39
5 changed files with 32 additions and 23 deletions

View File

@ -24,6 +24,8 @@ Thank you!
- [ ] Site / documentation update
- [ ] Demo update
- [ ] Workflow
- [ ] Chore
- [ ] Release
- [ ] Other (about what?)
### 🔗 Related issue link

View File

@ -22,6 +22,8 @@
- [ ] 网站/文档更新
- [ ] demo 更新
- [ ] Workflow
- [ ] 配置修改
- [ ] 发布
- [ ] 其他 (具体是什么,请补充?)
### 🔗 相关 issue 连接

View File

@ -35,33 +35,34 @@ jobs:
- name: Parse semver version from branch name
id: semver_parser
uses: release-kit/semver@v2
uses: xile611/read-package-version-action@v2.1
with:
string: ${{ github.ref_name }}
pattern: '^pre-release/(.*)$' # ^v?(.*)$ by default
path: packages/vtable
semver_string: ${{ github.ref_name }}
semver_pattern: '^pre-release/(.*)$' # ^v?(.*)$ by default
- name: Apply prereleaseName
run: node common/scripts/install-run-rush.js publish --apply --prerelease-name ${{ steps.semver_parser.outputs.prerelease }} --partial-prerelease
run: node common/scripts/install-run-rush.js publish --apply --prerelease-name ${{ steps.semver_parser.outputs.pre_release_name }} --partial-prerelease
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: node common/scripts/install-run-rush.js publish --publish --include-all --tag ${{ steps.semver_parser.outputs.prerelease }}
run: node common/scripts/install-run-rush.js publish --publish --include-all --tag ${{ steps.semver_parser.outputs.pre_release_type }}
- name: Update shrinkwrap
run: node common/scripts/install-run-rush.js update
- name: Get package version
- name: Get npm version
id: package-version
uses: culshaw/read-package-node-version-actions@v1
uses: xile611/read-package-version-action@v2.1
with:
path: './packages/vtable' # 各项目需要修改一下
path: packages/vtable
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'build: prelease version ${{ steps.package-version.outputs.version }}'
message: 'build: prelease version ${{ steps.package-version.outputs.current_version }}'
branch: ${{ github.ref_name }}
author_name: ${{ github.actor }}

View File

@ -35,6 +35,9 @@ jobs:
run: node common/scripts/install-run-rush.js install --bypass-policy
- name: Build packages
run: node common/scripts/install-run-rush.js build --only tag:package
- name: Update version
run: node common/scripts/install-run-rush.js version --bump
- name: Publish to npm
@ -46,35 +49,36 @@ jobs:
- name: Update shrinkwrap
run: node common/scripts/install-run-rush.js update
- name: Get package version
- name: Get npm version
id: package-version
uses: culshaw/read-package-node-version-actions@v1
uses: xile611/read-package-version-action@v2.1
with:
path: './packages/vtable' # 各项目修改一下
path: packages/vtable
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'build: prelease version ${{ steps.package-version.outputs.version }}'
message: 'build: prelease version ${{ steps.package-version.outputs.current_version }}'
branch: ${{ github.ref_name }}
- name: Create Release for Tag
id: release_tag
# See more about this action: https://github.com/actions/create-release
uses: actions/create-release@v1
uses: ncipollo/release-action@v1.12.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.package-version.outputs.version }}
release_name: Release v${{ steps.package-version.outputs.version }}
prerelease: false #
tag: v${{ steps.package-version.outputs.current_version }}
commit: main
prerelease: false
draft: true #
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
uses: dustinirving/create-pr@v1.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: '[Auto release] release ${{ steps.package-version.outputs.current_version }}'
base: main
branch: ${{ github.ref_name }}
title: '[Auto release] release ${{ steps.package-version.outputs.version }}'
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
head: ${{ github.ref_name }}
labels: release # default labels, the action will throw error if not specified
reviewers: fangsmile,Rui-Sun # default reviewers, the action will throw error if not specified

View File

@ -24,7 +24,7 @@ if [[ $STAGE_FILES != "" ]] ; then
if [[ $changedFiles != "" ]] ; then
echo "
[Notice]: please check, do you need to run ${RED}${BIG_FONT}rush change${RESET} to generate changelog,
[Notice]: please check, do you need to run ${RED}${BIG_FONT}rush change-all${RESET} to generate changelog,
you has modified some src files, include:
${changedFiles}
"