Skip to content

Commit

Permalink
Immidiately release snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoepelman committed Apr 2, 2024
1 parent 7f775ef commit 87d94b5
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ on:
push:
branches:
- main
- dhoepelman/auto_publish_ci
# For testing
- "dhoepelman/auto_publish_ci"
tags:
- 'v*'
permissions:
Expand Down Expand Up @@ -50,12 +51,40 @@ jobs:
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Is snapshot: $IS_SNAPSHOT"
echo "is_snapshot=$IS_SNAPSHOT" >> $GITHUB_OUTPUT
- name: Release version '${{ steps.get-version.outputs.version }}' to maven central
- name: Publish version '${{ steps.get-version.outputs.version }}' to sonatype & close staging repo
env:
CI_VERSION: ${{ steps.get-version.outputs.version }}
IS_SNAPSHOT: ${{ steps.get-version.outputs.is_snapshot }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
MAVEN_CENTRAL_TOKEN_USER: ${{ secrets.MAVEN_CENTRAL_TOKEN_USER }}
MAVEN_CENTRAL_TOKEN_PW: ${{ secrets.MAVEN_CENTRAL_TOKEN_PW }}
run: |
echo "Publishing version '$CI_VERSION' to maven central."
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --info
echo "Publishing version '$CI_VERSION' to sonatype."
if [[ $IS_SNAPSHOT == "true" ]]; then
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --info
else
./gradlew publishToSonatype closeSonatypeStagingRepository --info
fi
- uses: trstringer/manual-approval@v1
name: "Wait for approval to publish version '${{ steps.get-version.outputs.version }}'"
if: ${{ steps.get-version.outputs.is_snapshot == 'false' }}
with:
secret: ${{ github.TOKEN }}
approvers: dhoepelman,nlochschmidt
minimum-approvals: 1
issue-title: "Release version '${{ steps.get-version.outputs.version }}'"
issue-body: "Please approve or deny the release of version '${{ steps.get-version.outputs.version }}'."
# Default included: "approve", "approved", "lgtm", "yes"
additional-approved-words: ''
# Default included: "deny", "denied", "no"
additional-denied-words: ''

- name: "Release version '${{ steps.get-version.outputs.version }}'"
if: ${{ steps.get-version.outputs.is_snapshot == 'false' }}
env:
CI_VERSION: ${{ steps.get-version.outputs.version }}
MAVEN_CENTRAL_TOKEN_USER: ${{ secrets.MAVEN_CENTRAL_TOKEN_USER }}
MAVEN_CENTRAL_TOKEN_PW: ${{ secrets.MAVEN_CENTRAL_TOKEN_PW }}
run: ./gradlew findSonatypeStagingRepository releaseSonatypeStagingRepository --info

0 comments on commit 87d94b5

Please sign in to comment.