Release #588
This file contains 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
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
forceVersion: | |
description: 'Force version' | |
required: false | |
default: '' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
environment: ci | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Release | |
if: github.ref == 'refs/heads/master' | |
run: ./gradlew release -Prelease.customPassword=${GITHUB_TOKEN} -Prelease.customUsername=${GITHUB_ACTOR} -Prelease.forceVersion=${FORCE_VERSION} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
FORCE_VERSION: ${{ github.event.inputs.forceVersion }} | |
- name: Log new version | |
id: 'next-version' | |
run: | | |
NEW_HERMES_VERSION="`./gradlew -q cV -Prelease.quiet`" | |
echo "new_hermes_version=$NEW_HERMES_VERSION" >> $GITHUB_OUTPUT | |
echo "New Hermes version: ${NEW_HERMES_VERSION}" | |
- name: Publish to Sonatype | |
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
GPG_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }} | |
- name: Generate GitHub release page | |
if: github.ref == 'refs/heads/master' | |
run: gh release create "hermes-${{ steps.next-version.outputs.new_hermes_version }}" --generate-notes | |
env: | |
GH_TOKEN: ${{ github.token }} |