Skip to content

ci: automate release workflow for snapshots and stable versions #2

ci: automate release workflow for snapshots and stable versions

ci: automate release workflow for snapshots and stable versions #2

Workflow file for this run

name: Release
on:
pull_request:
push:
branches:
- main
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: Configure GPG
run: |
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
gpgconf --reload gpg-agent
- name: Publish to Maven Central
run: |
./mvnw clean deploy \
-P production-releases \
-D maven.test.skip=true \
-D gpg.passphrase="${MAVEN_GPG_PASSPHRASE}" \
-D gpg.args="--pinentry-mode=loopback" \
-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"