Skip to content

Commit c1d50a9

Browse files
committed
feat: add release workflow
1 parent 4d18e19 commit c1d50a9

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build and Release from Merged PR
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches: [main]
7+
8+
jobs:
9+
create-release:
10+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Extract version from pom.xml
18+
id: extract_version
19+
run: |
20+
VERSION=$(xmllint --xpath "/*[local-name()='project']/*[local-name()='version']/text()" pom.xml)
21+
echo "VERSION=$VERSION"
22+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
23+
24+
- name: Create GitHub Release with provenance
25+
uses: softprops/action-gh-release@v2
26+
with:
27+
tag_name: v${{ steps.extract_version.outputs.VERSION }}
28+
name: Release v${{ steps.extract_version.outputs.VERSION }}
29+
generate_release_notes: false
30+
draft: false
31+
prerelease: false
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)