Skip to content

Commit 5cbbb92

Browse files
committed
Automate release
1 parent 2e4bfe8 commit 5cbbb92

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release to maven-central
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
releaseversion:
6+
description: 'Release version'
7+
required: false
8+
default: 'X.Y.Z'
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- run: echo "Will release to central maven"
14+
15+
- uses: actions/checkout@v2
16+
17+
- name: Set up Maven Central Repository
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 8
21+
server-id: ossrh
22+
server-username: MAVEN_USERNAME
23+
server-password: MAVEN_PASSWORD
24+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
25+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
26+
27+
- name: Configure Git User
28+
run: |
29+
git config user.email "[email protected]"
30+
git config user.name "GitHub Actions"
31+
# - name: Set projects Maven version to GitHub Action GUI set version
32+
# run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}"
33+
34+
- name: Publish package
35+
run: mvn --batch-mode release:prepare release:perform -P release -DskipTests=true
36+
env:
37+
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
38+
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
39+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

0 commit comments

Comments
 (0)