-
Notifications
You must be signed in to change notification settings - Fork 228
ci: automate release workflow for snapshots and stable versions #1579
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
Merged
+72
−102
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a4ec64e
ci: automate release workflow for snapshots and stable versions
zimeg 073d44d
test: publish snapshot
zimeg 8671ad9
fix: configure gpg passphrase
zimeg 0ff2740
fix: attempt gpg reload
zimeg a18baa6
ci: add snapshot server credentials
zimeg 1558a92
ci: require approval
zimeg 453c6a7
test: confirm approval requirement
zimeg 3676504
revert: approval requirement
zimeg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: Publish | ||
| if: github.repository == 'slackapi/java-slack-sdk' | ||
| runs-on: ubuntu-latest | ||
| environment: central | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout the repo | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0 | ||
| with: | ||
| java-version: "17" | ||
| distribution: "adopt" | ||
| server-id: central | ||
| server-username: MAVEN_USERNAME | ||
| server-password: MAVEN_PASSWORD | ||
| gpg-private-key: ${{ secrets.GPG_KEY }} | ||
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
|
|
||
| - name: Add snapshot server credentials | ||
| run: | | ||
| sed -i '/<\/servers>/i \ | ||
| <server>\ | ||
| <id>central-snapshots</id>\ | ||
| <username>${env.MAVEN_USERNAME}</username>\ | ||
| <password>${env.MAVEN_PASSWORD}</password>\ | ||
| </server>' ~/.m2/settings.xml | ||
|
|
||
| - name: Configure GPG | ||
| run: | | ||
| echo "use-agent" >> ~/.gnupg/gpg.conf | ||
| echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf | ||
| echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf | ||
| echo RELOADAGENT | gpg-connect-agent | ||
|
|
||
| - name: Publish to Maven Central | ||
| run: | | ||
| ./mvnw clean deploy \ | ||
| -P production-releases \ | ||
| -D maven.test.skip=true \ | ||
| -D gpg.passphrase="${MAVEN_GPG_PASSPHRASE}" \ | ||
| -pl !bolt-kotlin-examples \ | ||
| -pl !bolt-quarkus-examples \ | ||
| --batch-mode \ | ||
| --no-transfer-progress | ||
| env: | ||
| MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | ||
| MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | ||
| MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
| MAVEN_OPTS: "--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED" | ||
This file contains hidden or 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
|
Member
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. 🫡 praise: Farewell to this |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🌲 praise: This was well documented here I found!
🔗 https://blog.7ori.dev/blog/2025/04/06/publishing-to-maven-central-with-github-actions/