-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 1.89 KB
/
build-and-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
name: Release to Maven Central
on:
release:
types: [ released ]
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
outputs:
new-version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 19
uses: actions/setup-java@v4
with:
java-version: '19'
distribution: 'corretto'
cache: maven
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
- name: Get next version
uses: reecetech/[email protected]
id: version
with:
release_branch: master
scheme: semver
increment: patch
- name: Update version in pom.xml
run: mvn -B versions:set -DnewVersion=${{ steps.version.outputs.current-version }} -DgenerateBackupPoms=false
- name: Verify and deploy
run: mvn -B deploy --file pom.xml
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
after-release:
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/checkout@v4
with:
ref: ${{ vars.DEV_BRANCH }}
- name: Setup git config
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Setup next version
run: mvn -B versions:set -DnewVersion=${{ needs.release.outputs.new-version }} -DgenerateBackupPoms=false
- name: Commit and push
run: |
git add -A
git commit -m "Prepare pom for new iteration"
git push
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6