Skip to content

Commit 9ce1f5b

Browse files
committed
Add release GH script
1 parent 97a27f2 commit 9ce1f5b

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release new version
2+
3+
on:
4+
workflow_dispatch
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Set up JDK
12+
uses: actions/setup-java@v4
13+
with:
14+
distribution: 'temurin'
15+
java-version: '17'
16+
cache: maven
17+
server-id: central # Value of the distributionManagement/repository/id field of the pom.xml
18+
server-username: SONATYPE_USERNAME
19+
server-password: SONATYPE_PASSWORD
20+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # has to be read directly from secrets
21+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # default name used by maven-gpg-plugin
22+
23+
- name: Setup git profile
24+
run: |
25+
git config --global user.name "github-actions[bot]"
26+
git config --global user.email "123456+github-actions[bot]@users.noreply.github.com"
27+
28+
- name: Release new version
29+
run:
30+
mvn -B release:clean release:prepare release:perform -P release
31+
env:
32+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
33+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
34+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

0 commit comments

Comments
 (0)