Skip to content

Release

Release #1

Workflow file for this run

name: Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-RC[0-9]+"
workflow_dispatch:
inputs:
tag:
description: "Git tag to release from"
required: true
type: string
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false
jobs:
publish:
env:
ORT_SERVER_VERSION: ${{ inputs.tag || github.ref_name }}
permissions:
contents: write
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: ${{ env.ORT_SERVER_VERSION }}
fetch-depth: 0
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4
with:
dependency-graph: generate-and-submit
- name: Publish to OSSRH
env:
GITHUB_DEPENDENCY_GRAPH_REF: refs/heads/main
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED: true
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GPG_SUBKEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GPG_PASSPHRASE }}
SONATYPE_CONNECT_TIMEOUT_SECONDS: 300
run: ./gradlew --stacktrace --no-configuration-cache publishAndReleaseToMavenCentral
- name: Generate Release Notes
run: ./gradlew -q printChangeLog > RELEASE_NOTES.md
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ "$ORT_SERVER_VERSION" =~ -RC[0-9]+ ]]; then
PRERELEASE_ARG="--prerelease"
fi
gh release create $ORT_SERVER_VERSION --notes-file RELEASE_NOTES.md $PRERELEASE_ARG