Merge branch of workflows #8
Workflow file for this run
This file contains hidden or 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
| # 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" | |
| - name: Set up Node.js (required by TypeScript discovery plugin) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| # ----------------------------------------------------------------------- | |
| # 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 |