Skip to content

Commit 0379406

Browse files
committed
release actions
1 parent e880689 commit 0379406

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/workflows/create-tag.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Create Tag
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths-ignore:
7+
- '.github/**'
8+
- '**/AUTHORS.md'
9+
- '**/LICENSE'
10+
- '**/README.md'
11+
12+
jobs:
13+
create-tag:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
- name: Get Info
19+
run: |
20+
echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT
21+
id: info
22+
- name: Create Tag
23+
run: |
24+
git config user.name "$GITHUB_ACTOR"
25+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
26+
git tag -a 'v${{ steps.info.outputs.version }}' -m 'Release/v${{ steps.info.outputs.version }}'
27+
git push origin 'v${{ steps.info.outputs.version }}'

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v4
17+
- name: Get Info
18+
run: |
19+
echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT
20+
id: info
21+
- name: Generate Changelog
22+
run: |
23+
awk 'BEGIN {found=0} /^## [0-9]/ {if (!found) {found=1; next} else exit} found {print}' CHANGELOG.md > RELEASE.md
24+
- name: Create Release
25+
uses: ncipollo/release-action@v1
26+
id: create_release
27+
with:
28+
bodyFile: RELEASE.md
29+
tag: v${{ steps.info.outputs.version }}

0 commit comments

Comments
 (0)