Skip to content

ci: release to maven on merge (#1423) #1

ci: release to maven on merge (#1423)

ci: release to maven on merge (#1423) #1

Workflow file for this run

name: Release
permissions:
# The commitizen action pushes a new commit to the main
# branch to generate the changelog + tag, so needs write
# permission
contents: write
on:
push:
branches:
- 'master'
jobs:
bump_version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version"
outputs:
version: ${{ steps.cz.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch tags, which are required to calculate the new version
token: "${{ secrets.GITHUB_TOKEN }}"
- id: cz
name: "Generate Changelog and Tag"
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release:
needs: bump_version
runs-on: ubuntu-latest
name: "Release"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.bump_version.outputs.version }}
- name: "Set up JDK"
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: "Sign and Release"
env:
GRADLE_SIGNING_KEY: "${{ secrets.GRADLE_SIGNING_KEY }}"
GRADLE_SIGNING_PASSWORD: "${{ secrets.GRADLE_SIGNING_PASSWORD }}"
OSSRH_USERNAME: "${{ secrets.OSSRH_USERNAME }}"
OSSRH_PASSWORD: "${{ secrets.OSSRH_PASSWORD }}"
# Exclude client-rest as it's not part of the java release
run: ./gradlew clean build sign uploadArchives --exclude-task :client-rest:uploadArchives