Skip to content

Commit 60e5b24

Browse files
authored
Create component-release.yml
1 parent 07fd812 commit 60e5b24

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Component Release
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Git
17+
run: |
18+
git config --global user.name "GitHub Actions"
19+
git config --global user.email "[email protected]"
20+
21+
- name: Clone the project and start release
22+
run: |
23+
git clone https://github.com/${{ github.repository }} project
24+
cd project
25+
git fetch origin main:main
26+
git flow init -d
27+
28+
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
29+
if [ -z "$LATEST_TAG" ]; then
30+
  RELEASE_VERSION="v1.0.0"
31+
else
32+
  RELEASE_VERSION=$(echo $LATEST_TAG | awk -F. -v OFS=. '{$NF++;print}')
33+
fi
34+
35+
git flow release start $RELEASE_VERSION
36+
auto-changelog -v $RELEASE_VERSION
37+
git add CHANGELOG.md
38+
git commit -m "$RELEASE_VERSION release changelog updates"
39+
git flow release publish
40+
41+
- name: Finish release and push
42+
run: |
43+
cd project
44+
git flow release finish 1.0.0
45+
git push origin main
46+
git push origin --tags
47+
git push origin develop

0 commit comments

Comments
 (0)