-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·35 lines (35 loc) · 1.25 KB
/
manualRelease.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Release and Publish
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check-out
uses: actions/checkout@v4
- name: Set up Java for publishing to Maven Central Packages
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
server-id: central
server-username: SONATYPE_USERNAME
server-password: SONATYPE_TOKEN
- name: Release with Maven
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
mvn -B -ntp -Dstyle.color=always release:prepare
VERSION=`cat release.properties | grep scm.tag= | cut -d'=' -f2`
mvn -B -ntp -Dstyle.color=always release:perform
echo "Released ${VERSION} 🚀" >> $GITHUB_STEP_SUMMARY
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_USERNAME: ${{ secrets.OSSRH_USERNAME }}
SONATYPE_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}