-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (77 loc) · 2.73 KB
/
release.yaml
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
76
77
78
79
80
name: Release
on:
push:
branches:
- main
release:
types: [created]
permissions:
contents: read
packages: write
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@f2acddfb5195534d487896a656232b016a682f3c # v1.9.0
with:
app-id: "${{ secrets.APP_ID }}"
private-key: "${{ secrets.AUTOMATION_KEY }}"
- uses: google-github-actions/release-please-action@v4
with:
token: "${{ steps.generate_token.outputs.token }}"
config-file: release-please.json
manifest-file: .release-please-manifest.json
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up JDK
uses: actions/setup-java@5896cecc08fd8a1fbdfaf517e29b571164b031f7
with:
java-version: "21"
distribution: "temurin"
server-id: github
# stage maven profile
- name: Set up JDK to publish to GitHub Packages
if: github.ref == 'refs/heads/main'
uses: actions/setup-java@5896cecc08fd8a1fbdfaf517e29b571164b031f7
with:
java-version: "21"
distribution: "temurin"
# write settings.xml
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
gpg-private-key: ${{ secrets.GPG_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to GitHub Packages
if: github.ref == 'refs/heads/main'
run: mvn --batch-mode deploy -DskipTests -P stage
env:
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }}
# release maven profile
- name: Set up JDK to publish to Maven Central
if: startsWith(github.ref, 'refs/tags/')
uses: actions/setup-java@5896cecc08fd8a1fbdfaf517e29b571164b031f7
with:
java-version: "21"
distribution: "temurin"
# write settings.xml
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to Maven Central
if: startsWith(github.ref, 'refs/tags/')
run: mvn --batch-mode deploy -DskipTests -P release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }}