release #33
Workflow file for this run
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: | |
version: | |
description: "The release version (e.g., '1.9.0')." | |
required: true | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fail if branch is not main | |
if: github.ref != 'refs/heads/main' && github.ref != 'refs/heads/main-v2' | |
run: | | |
echo "This workflow should only be triggered on main and main-v2 branch. | |
exit 1 | |
- name: Checkout the repo | |
uses: actions/checkout@v4 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: publish release | |
run: ./gradlew publishToSonatype closeAndReleaseStagingRepositories | |
env: | |
RELEASE_VERSION: ${{ github.event.inputs.version }} | |
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }} | |
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} | |
- name: create release | |
run: gh release create "v${RELEASE_VERSION}" --generate-notes --target "${GITHUB_REF}" | |
env: | |
RELEASE_VERSION: ${{ github.event.inputs.version }} | |
GH_TOKEN: ${{ github.token }} |