-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,26 +2,18 @@ name: Release to Maven Central | |
|
||
on: | ||
release: | ||
types: [ published ] | ||
types: [ released ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
|
||
|
||
jobs: | ||
build-for-release: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
new-version: ${{ steps.version.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: master | ||
- name: Setup git config | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
- name: Set up JDK 19 | ||
uses: actions/setup-java@v4 | ||
with: | ||
|
@@ -33,14 +25,44 @@ jobs: | |
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_CENTRAL_TOKEN | ||
|
||
- if: github.event.release | ||
name: Update version in pom.xml (Release only) | ||
run: mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false | ||
- 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: ${{ env.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 }}-SNAPSHOT -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters