-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(automation release): standard commit msg and release workflow
- Loading branch information
Showing
5 changed files
with
106 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: ["v*"] | ||
|
||
jobs: | ||
github_release: | ||
name: Trigger GitHub release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the new tag | ||
uses: actions/[email protected] | ||
|
||
- name: Get tag info | ||
id: tags | ||
uses: babel/actions/get-release-tags@v2 | ||
|
||
- name: Generate the changelog | ||
id: changelog | ||
uses: babel/actions/generate-lerna-changelog@v2 | ||
with: | ||
from: ${{ steps.tags.outputs.old }} | ||
to: ${{ steps.tags.outputs.new }} | ||
env: | ||
GITHUB_AUTH: ${{ secrets.ACCESS_TOKEN }} | ||
|
||
- name: Create a draft GitHub release | ||
uses: babel/actions/publish-github-release@v2 | ||
with: | ||
tag: ${{ steps.tags.outputs.new }} | ||
changelog: ${{ steps.changelog.outputs.changelog }} | ||
token: ${{ secrets.ACCESS_TOKEN }} | ||
|
||
- name: Check if releasing from master | ||
id: is_master | ||
uses: babel/actions/ref-matches-branch@v2 | ||
with: | ||
name: master | ||
|
||
- name: Update CHANGELOG.md | ||
if: steps.is_master.outputs.result == 1 | ||
uses: babel/actions/update-changelog@v2 | ||
with: | ||
changelog: ${{ steps.changelog.outputs.changelog }} | ||
|
||
- name: Commit CHANGELOG.md | ||
if: steps.is_master.outputs.result == 1 | ||
run: | | ||
git add CHANGELOG.md | ||
git -c user.name="wanchun" -c user.email="[email protected]" \ | ||
commit -m "Add ${{ steps.tags.outputs.new }} to CHANGELOG.md [skip ci]" --no-verify --quiet | ||
git push "https://wanchun:${{ secrets.ACCESS_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { extends: ['@commitlint/config-conventional'] }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
{ | ||
"version": "0.1.0", | ||
"changelog": { | ||
"repo": "WeBankFinTech/fes.js", | ||
"cacheDir": ".changelog", | ||
"labels": { | ||
"PR: Spec Compliance :eyeglasses:": ":eyeglasses: Spec Compliance", | ||
"PR: Breaking Change :boom:": ":boom: Breaking Change", | ||
"PR: New Feature :rocket:": ":rocket: New Feature", | ||
"PR: Bug Fix :bug:": ":bug: Bug Fix", | ||
"PR: Polish :nail_care:": ":nail_care: Polish", | ||
"PR: Docs :memo:": ":memo: Documentation", | ||
"PR: Internal :house:": ":house: Internal", | ||
"PR: Performance :running_woman:": ":running_woman: Performance", | ||
"PR: Revert :leftwards_arrow_with_hook:": ":leftwards_arrow_with_hook: Revert" | ||
} | ||
}, | ||
"command": { | ||
"publish": { | ||
"ignoreChanges": ["*.md", "**/test/**"] | ||
}, | ||
"version": { | ||
"push": false | ||
} | ||
}, | ||
"packages": [ | ||
"packages/*" | ||
], | ||
"version": "independent", | ||
"npmClient": "npm" | ||
"npmClient": "npm", | ||
"ignoreChanges": ["**/fes-doc/**", "**/test/**", "**/*.md"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters