fix release build handling on ci #15
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: 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/release-action@v1.14.0 | |
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 }} |