-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (57 loc) · 1.87 KB
/
main_ci.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
name: Main CI (Release)
on:
push:
branches:
- main
jobs:
build:
permissions:
contents: read
packages: write
uses: ./.github/workflows/build.yml
deploy:
needs: build
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'corretto'
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Set GPG Key for Signing
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
echo "default-key ${GPG_KEY_ID}" >> ~/.gnupg/gpg.conf
echo "use-agent" >> ~/.gnupg/gpg.conf
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Set Git user for release
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
- name: Grant execute permission for Maven Wrapper
run: chmod +x ./mvnw
- name: Bump Version and Release (Maven Release Plugin)
run: |
echo "Releasing and bumping version..."
./mvnw \
-Darguments=-DskipTests \
-Dgpg.keyname=${{ secrets.GPG_KEY_ID }} \
-Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \
release:prepare release:perform -B -P release
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}