-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 2.13 KB
/
release.yml
File metadata and controls
64 lines (56 loc) · 2.13 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Release CI
on:
push:
branches:
- "main"
jobs:
build:
name: Release CI
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: 17
distribution: "adopt"
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Cache local Maven repository
uses: actions/cache@v5
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-build-${{ matrix.java }}-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
# semantic-release:release will fail, when no release required
- name: Release with Maven
run: mvn --batch-mode semantic-release:release
id: release
continue-on-error: true
- name: Sync develop
run: |
git checkout develop
git merge main
git push
if: steps.release.outcome == 'success' && steps.release.conclusion == 'success'
continue-on-error: true
#- name: Deploy with Maven
# run: mvn --batch-mode deploy
# env:
# OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
# OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
# if: steps.release.outcome == 'success' && steps.release.conclusion == 'success'
#- name: Deploy with Maven
# run: mvn --batch-mode deploy -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/$REPOSITORY_OWNER/$REPOSITORY_NAME
# env:
# GITHUB_ACTOR: $GITHUB_ACTOR
# GITHUB_TOKEN: ${{ github.token }}
# REPOSITORY_OWNER: ${{ github.repository_owner }}
# REPOSITORY_NAME: ${{ github.event.repository.name }}
# if: steps.release.outcome == 'success' && steps.release.conclusion == 'success'