Skip to content

Commit 6a3da13

Browse files
authored
Create ci.yml
1 parent 9fa3178 commit 6a3da13

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Realse Version
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
branches:
7+
- main
8+
9+
jobs:
10+
build:
11+
if: github.event.pull_request.merged == true
12+
runs-on: ubuntu-22.04
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.pull_request.merge_commit_sha }}
20+
fetch-depth: '0'
21+
22+
- name: Bump version and push tag
23+
id: bump
24+
uses: anothrNick/github-tag-action@v1
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.TOKEN }}
27+
WITH_V: true
28+
DEFAULT_BUMP: patch
29+
30+
- name: Build Changelog
31+
id: github_release
32+
uses: mikepenz/release-changelog-builder-action@v5
33+
with:
34+
mode: "COMMIT"
35+
configurationJson: |
36+
{
37+
"template": "#{{CHANGELOG}}",
38+
"categories": [
39+
{
40+
"title": "## Feature",
41+
"labels": ["feat", "feature"]
42+
},
43+
{
44+
"title": "## Fix",
45+
"labels": ["fix", "bug"]
46+
},
47+
{
48+
"title": "## Other",
49+
"labels": []
50+
}
51+
],
52+
"label_extractor": [
53+
{
54+
"pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\\([\\w\\-\\.]+\\))?(!)?: (.*?)([\\s\\S]*)?",
55+
"target": "$1"
56+
}
57+
]
58+
}
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.TOKEN }}
61+
fromTag: ${{ steps.bump.outputs.previous_tag }}
62+
toTag: ${{ steps.bump.outputs.new_tag }}
63+
64+
- name: Create Release
65+
uses: mikepenz/action-gh-release@v0.2.0-a03 #softprops/action-gh-release
66+
with:
67+
body: ${{steps.github_release.outputs.changelog}}
68+
tag_name: ${{ steps.bump.outputs.new_tag }}

0 commit comments

Comments
 (0)