-
Notifications
You must be signed in to change notification settings - Fork 33
Fix Release Workflow to publish in Maven Central. #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,20 +28,28 @@ jobs: | |
| java-version: 8 | ||
| server-id: central | ||
| distribution: "adopt" | ||
| server-username: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | ||
| server-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | ||
| server-username: MAVEN_CENTRAL_USERNAME | ||
| server-password: MAVEN_CENTRAL_PASSWORD | ||
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
| gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
|
|
||
| gpg-passphrase: GPG_PASSPHRASE | ||
| # This step runs ONLY on branch pushes (dry-run) | ||
| - name: Run Release Dry-Run (Verify) | ||
| if: "!startsWith(github.ref, 'refs/tags/')" | ||
| run: mvn -Prelease -DskipTests=true --batch-mode verify | ||
| env: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No private key needed here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto reason. |
||
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
| MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | ||
| MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | ||
|
|
||
| # This step runs ONLY on tag pushes (real release) | ||
| - name: Publish to Maven Central Repository (Deploy) | ||
| if: "startsWith(github.ref, 'refs/tags/')" | ||
| run: mvn -Prelease -DskipTests=true --batch-mode deploy | ||
| env: | ||
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
| MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | ||
| MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | ||
|
|
||
| # This step also runs ONLY on tag pushes (real release) | ||
| - name: Create GitHub release | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the issue with the old way?
Why it does not apply to the private key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just changed this to the old behavior that we changed here. I actually can't figure out where this key is exactly used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue with the current behaviour is that the secret is passed in the format of {env.Secret}. Which corrupts the secret.