Skip to content

Cleanup part two: CI/CD overhaul #32

Cleanup part two: CI/CD overhaul

Cleanup part two: CI/CD overhaul #32

name: Publish Release
on:
push:
branches:
- stable
paths:
- '**/gradle.properties'
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v4
# https://github.com/marketplace/actions/setup-java-jdk
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
# https://github.com/marketplace/actions/build-with-gradle
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
# https://github.com/marketplace/actions/generate-version
- name: Get release version
uses: HardNorth/[email protected]
with:
version-source: file
version-file: gradle.properties
version-file-extraction-pattern: '(?<=version=).+'
- name: Get changelog
run: ./gradlew getChangelog --console=plain -q --no-header --no-summary > LATEST_CHANGES.md
- name: Build artifacts
run: ./gradlew shadowJar
# https://github.com/marketplace/actions/create-release
- name: Create release
uses: ncipollo/release-action@v1
with:
name: Gateway ${{ env.RELEASE_VERSION }}
tag: v${{ env.RELEASE_VERSION }}
bodyFile: 'LATEST_CHANGES.md'
artifacts: 'build/libs/*.jar'
prerelease: ${{ !!env.RELEASE_VERSION_PRERELEASE }}
token: ${{ secrets.GITHUB_TOKEN }}