Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
HamzaJugon authored Oct 21, 2024
1 parent eabe909 commit 29a7bbd
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
description: "The branch to use to release from."
required: true
default: "main"

jobs:
release:
name: Release to Maven Central
Expand All @@ -20,19 +21,23 @@ jobs:
# We need a personal access token to be able to push to a protected branch
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

- name: Ensure release is from the master/main branch
if: ${{ github.event.inputs.branch != 'main' && github.event.inputs.branch != 'master' }}
run: |
echo "Releases can only be made from the master/main branch. Exiting."
exit 1
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
java-package: jdk
server-id: sonatype-nexus-staging # Value of the distributionManagement/repository/id field of the pom.xml
server-username: SONATYPE_USERNAME # env variable for username in deploy
server-password: SONATYPE_PASSWORD # env variable for token in deploy
# only signed artifacts will be released to maven central. this sets up things for the maven-gpg-plugin
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase
# this creates a settings.xml with the following server
server-id: sonatype-nexus-staging
server-username: SONATYPE_USERNAME
server-password: SONATYPE_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
settings-path: ${{ github.workspace }}

- name: Configure Git User
Expand Down

0 comments on commit 29a7bbd

Please sign in to comment.