-
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.
- favor one profile to do the release over multiple - install mvn wrapper
- Loading branch information
1 parent
2f21ca6
commit b7765fd
Showing
4 changed files
with
25 additions
and
77 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
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 |
---|---|---|
@@ -1,59 +1,27 @@ | ||
name: release | ||
|
||
name: Release and Publish package to the Maven Central Repository | ||
on: | ||
workflow_dispatch: | ||
|
||
push: | ||
tags: | ||
- v* | ||
pull_request: | ||
branches: [ main ] | ||
jobs: | ||
release: | ||
name: Release | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Configure build steps as you'd normally do | ||
|
||
- name: Setup Java | ||
- uses: actions/checkout@v3 | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 21 | ||
distribution: 'zulu' | ||
server-id: central | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_CENTRAL_TOKEN | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
|
||
# Post JARs to Maven Central | ||
|
||
- name: Release to Maven Central | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
run: | | ||
export GPG_TTY=$(tty) | ||
git config user.name "JonasG" | ||
git config user.email "[email protected]" | ||
mvn -B --file pom.xml release:prepare release:perform | ||
# Create a release | ||
|
||
- name: Run JReleaser | ||
uses: jreleaser/release-action@v2 | ||
java-version: '17' | ||
distribution: 'adopt' | ||
- name: Publish package | ||
env: | ||
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }} | ||
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }} | ||
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} | ||
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} | ||
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} | ||
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: ./mvnw -Prelease deploy jreleaser:full-release -DaltDeploymentRepository=local::file:./target/staging-deploy --non-recursive | ||
|
||
# Persist logs | ||
|
||
- name: JReleaser release output | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: jreleaser-release | ||
path: | | ||
out/jreleaser/trace.log | ||
out/jreleaser/output.properties |
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
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