-
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (38 loc) · 1.63 KB
/
release.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
36
37
38
name: Release
on:
release:
types: [ created, published ]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE # Env var that holds the key's passphrase
- if: github.event.release
name: Update version in pom.xml (Release only)
run: mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false
- name: Publish to the Maven Central Repository
run: mvn --no-transfer-progress --batch-mode deploy -DperformRelease=true
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME_OSSRH }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD_OSSRH }}
MAVEN_OPTS: "--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: '{{ EVENT_PAYLOAD.repository.full_name }} version {{ EVENT_PAYLOAD.release.name }} is out!'