Skip to content

Release

Release #4

Workflow file for this run

# Triggered automatically when Gitea mirrors a release@x.y.z tag to GitHub.
# Builds the standard application distribution archives (zip + tar) and
# publishes them as assets on the corresponding GitHub Release.
name: Release
on:
push:
tags:
- 'release@*'
permissions:
contents: write # required to create GitHub Releases and upload assets
jobs:
build-and-release:
name: Build distribution and publish release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # full history + all tags are required by com.palantir.git-version
- name: Set up JDK 21 (Temurin)
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
build-scan-publish: true
build-scan-terms-of-service-url: "https://gradle.com/help/legal-terms-of-use"
build-scan-terms-of-service-agree: "yes"
# -----------------------------------------------------------------------
# Quality gate – explicit named steps so each check is visible in the log.
# -----------------------------------------------------------------------
- name: Run tests
run: ./gradlew test
- name: Verify JaCoCo instruction coverage ≥ 70 %
run: ./gradlew jacocoTestCoverageVerification
- name: PMD static analysis
run: ./gradlew pmdMain
- name: SpotBugs analysis
run: ./gradlew spotbugsMain
# -----------------------------------------------------------------------
# Build artefacts
# -----------------------------------------------------------------------
- name: Build distribution archives
run: ./gradlew distZip distTar
- name: Generate CycloneDX SBOM
run: ./gradlew cyclonedxBom
# -----------------------------------------------------------------------
# Changelog via git-cliff (reads cliff.toml at repo root)
# -----------------------------------------------------------------------
- name: Install git-cliff
uses: taiki-e/install-action@v2
with:
tool: git-cliff
- name: Generate changelog
run: |
git-cliff --tag "$GITHUB_REF_NAME" \
--output /tmp/CHANGELOG_RELEASE.md
# -----------------------------------------------------------------------
# Publish release
# The tag name is release@x.y.z; strip the prefix to get the plain version.
# -----------------------------------------------------------------------
- name: Publish GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${GITHUB_REF_NAME#release@}"
gh release create "$GITHUB_REF_NAME" \
--title "MethodAtlas ${VERSION}" \
--notes-file /tmp/CHANGELOG_RELEASE.md \
build/distributions/*.zip \
build/distributions/*.tar \
build/reports/cyclonedx/bom.json