Merge branch 'release/4.6.1' #6
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 GitHub Release | |
on: | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: 'Tag to run workflow on' | |
required: true | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.ref || github.ref_name }} | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
cache: 'gradle' | |
- name: Cache Gradle | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Build project | |
run: ./gradlew build | |
- name: Extract Changelog for Release | |
id: changelog | |
run: | | |
TAG_NAME="${GITHUB_REF##*/}" | |
VERSION="${TAG_NAME#v}" | |
sed -n "/## Version $VERSION/,/## Version/p" CHANGELOG.md | sed '1d;$d' | awk 'NF || p {print} {p = NF}' > release_notes.md | |
env: | |
GITHUB_REF: ${{ github.ref }} | |
- name: Create GitHub Release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "build/libs/*.jar" | |
bodyFile: "release_notes.md" | |
tag: ${{ github.ref_name }} | |
name: "Release ${{ github.ref_name }}" | |
draft: true |