forked from engine-alpha/engine-alpha
-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (43 loc) · 1.76 KB
/
deploy-maven-central.yml
File metadata and controls
50 lines (43 loc) · 1.76 KB
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
# https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#publishing-using-apache-maven
name: Publish package to the Maven Central Repository
on:
push:
# Pattern matched against refs/tags
tags:
- "*" # Push events to every tag not containing /
jobs:
publish:
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- name: Checkout the repository
uses: actions/checkout@v6
with:
submodules: true
# https://github.com/actions/setup-java
- name: Set up Maven Central Repository
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
server-id: central # see pom.xml <publishingServerId>central</publishingServerId>
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
# gpg --armor --export-secret-keys <key_id> > gpg_key.asc
# cat gpg_key.asc
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase
# https://github.com/marketplace/actions/setup-just
- uses: extractions/setup-just@v3
- name: Sync the assets with some resources folder
run: just assets_sync_resources
- name: Package build-tools is requried by javadoc
run: mvn install --projects de.pirckheimer-gymnasium:engine-pi-build-tools
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Publish package
run: mvn --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}