Skip to content

Publish a new Release #14

Publish a new Release

Publish a new Release #14

Workflow file for this run

name: Publish a new Release
on:
push:
tags:
- '2.*'
workflow_dispatch:
inputs:
tag:
required: true
type: string
description: 'Tag to use for the release and changelog'
concurrency:
group: "publish"
cancel-in-progress: true
jobs:
publish:
runs-on: macos-latest
environment: publishing
steps:
- uses: actions/checkout@v4
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
check-latest: true
java-version: 22
cache: 'gradle'
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Publish to sonatype
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
run: ./gradlew publishToMavenCentral --no-configuration-cache
- name: Generate Changelog
uses: mikepenz/release-changelog-builder-action@v4
id: build_changelog
with:
commitMode: true
configuration: ".github/changelog_config.json"
- name: Create GH release
uses: ncipollo/[email protected]
id: create_release
with:
draft: true
artifactErrorsFailBuild: true
prerelease: false
body: ${{steps.build_changelog.outputs.changelog}}
tag: ${{ inputs.tag != '' && inputs.tag || github.ref_name }}
env:
GITHUB_TOKEN: ${{ github.token }}