-
Notifications
You must be signed in to change notification settings - Fork 25
75 lines (67 loc) · 2.64 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Release
on:
push:
tags:
- '2020.2021-*'
- '2021.2022-*'
- '2021.2022'
- '2021.2022.*'
- '2022.2023.*'
- '2022.2023-*'
- '2022.2023'
- '2023.2024'
- '2023.2024-*'
- '2024.2025'
- '2024.2025-*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- name: Set up JDK 21
uses: actions/setup-java@v4.5.0
with:
distribution: 'zulu'
java-version: 21
server-id: ossrh
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_PASSWORD
- name: Cache Maven packages
uses: actions/cache@v4.1.2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6.2.0
with:
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Build Project for release & Deploy
run: xvfb-run mvn package deploy -P release -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
env:
# MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
# MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
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"
# - name: Set up Apache Maven Central
# uses: actions/setup-java@v4.5.0
# with:
# distribution: 'zulu'
# java-version: 21
# server-id: ossrh
# server-username: MAVEN_CENTRAL_USERNAME
# server-password: MAVEN_CENTRAL_PASSWORD
#
# - name: Deploy to the Maven Central Repository
# run: mvn deploy -P release -DskipTests -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -Dgpg.executable=gpg
# env:
# MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
# MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
# 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"
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
artifacts: "target/*.jar"
bodyFile: "release.md"
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}