From 1ade1c2f557ac8d36fbc388b0f7f5cad32bf9fc8 Mon Sep 17 00:00:00 2001 From: TheMeinerLP Date: Fri, 21 Aug 2026 19:18:12 +0200 Subject: [PATCH 1/4] chore(ci): adopt shared workflows and central Renovate preset - renovate.json -> central preset (pandorascluster-maintainers) - security.yml (Trivy + CycloneDX SBOM) - build-pr.yml (gradle-build-pr, Java 24, run-tests: true) (replaced hand-rolled job) - close_invalid_prs.yml (replaced hand-rolled job) - pinned reusable workflows to v2.8.1 (close_invalid_prs.yml,build-pr.yml) --- .github/workflows/build-pr.yml | 53 ++++++++---------------- .github/workflows/close_invalid_prs.yml | 12 ++---- .github/workflows/security.yml | 55 +++++++++++++++++++++++++ renovate.json | 14 +------ 4 files changed, 78 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/security.yml diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 119cf59d..463459c4 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -1,38 +1,19 @@ name: Build PR -on: [pull_request] + +on: + pull_request: + +permissions: + contents: read + checks: write + pull-requests: write + jobs: - build_pr: - if: github.repository_owner == 'OneLiteFeatherNET' - name: Build Pull Request Branch - runs-on: ${{ matrix.os }} - env: - ONELITEFEATHER_MAVEN_USERNAME: ${{ secrets.ONELITEFEATHER_MAVEN_USERNAME }} - ONELITEFEATHER_MAVEN_PASSWORD: ${{ secrets.ONELITEFEATHER_MAVEN_PASSWORD }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - steps: - - name: Checkout Repository - uses: actions/checkout@v7 - - name: Setup Java - uses: actions/setup-java@v5 - with: - distribution: temurin - java-version: 24 - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v6 - - name: Build on ${{ matrix.os }} - run: ./gradlew clean build test -# - name: Generate JaCoCo Coverage Report -# if: matrix.os == 'ubuntu-latest' -# run: ./gradlew jacocoTestReport -# - name: Jacoco Report to PR -# id: jacoco -# uses: madrapps/jacoco-report@v1.7.2 -# with: -# paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml -# token: ${{ secrets.GITHUB_TOKEN }} -# min-coverage-overall: 40 -# min-coverage-changed-files: 60 -# title: Code Coverage -# update-comment: true + build: + # Shared org build: Temurin toolchain, 3-OS matrix, tests and coverage. + uses: OneLiteFeatherNET/workflows/.github/workflows/gradle-build-pr.yml@v2.8.1 + with: + java-version: "24" + java-distribution: "temurin" + run-tests: true + secrets: inherit diff --git a/.github/workflows/close_invalid_prs.yml b/.github/workflows/close_invalid_prs.yml index 432d368a..bd99444f 100644 --- a/.github/workflows/close_invalid_prs.yml +++ b/.github/workflows/close_invalid_prs.yml @@ -2,13 +2,9 @@ name: Close invalid PRs on: pull_request_target: - types: [ opened ] + types: [opened] jobs: - run: - if: ${{ github.repository != github.event.pull_request.head.repo.full_name && github.head_ref == 'main' }} - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: "Please do not open pull requests from the `main` branch, create a new branch instead." \ No newline at end of file + close: + uses: OneLiteFeatherNET/workflows/.github/workflows/close-invalid-prs.yml@v2.8.1 + secrets: inherit diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 00000000..ae1cae33 --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,55 @@ +name: Security + +# Trivy vulnerability gate plus a CycloneDX SBOM of the repository. Self-contained +# on purpose: it needs no build tool and no registry credentials, so it is the +# baseline security gate for every repository regardless of language. +on: + pull_request: + push: + branches: [main] + schedule: + - cron: "44 4 * * 1" + workflow_dispatch: +permissions: + contents: read + security-events: write + +jobs: + trivy: + name: Trivy scan + uses: OneLiteFeatherNET/workflows/.github/workflows/security-scan.yml@v2.8.1 + with: + scan-type: "fs" + scanners: "vuln,secret" + severity: "CRITICAL,HIGH" + # Report-only for now, so adopting this does not turn CI red on day one. + fail-on-findings: false + upload-sarif: true + secrets: inherit + + sbom: + name: CycloneDX SBOM + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Generate SBOM + uses: aquasecurity/trivy-action@v0.36.0 + with: + scan-type: fs + scan-ref: . + format: cyclonedx + output: bom.json + # An SBOM is an inventory, not a finding list - never fail on it. + exit-code: '0' + + - name: Upload SBOM + uses: actions/upload-artifact@v4 + with: + name: sbom-cyclonedx + path: bom.json + if-no-files-found: error + retention-days: 90 diff --git a/renovate.json b/renovate.json index b2122a82..b2e4bd3d 100644 --- a/renovate.json +++ b/renovate.json @@ -1,16 +1,6 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "config:recommended", - ":automergePatch", - ":assignee(onelitefeather/pandorascluster-maintainers)", - ":timezone(Europe/Berlin)", - "schedule:officeHours", - "schedule:automergeOfficeHours", - ":semanticCommits", - ":label(renovate)", - ":enableVulnerabilityAlerts", - "github>onelitefeathernet/renovate:paper" - ], - "rebaseWhen": "conflicted" + "github>OneLiteFeatherNET/renovate:default(OneLiteFeatherNET/pandorascluster-maintainers)" + ] } From a01354d1ac482b51d39b93a14dcacf01318d1be3 Mon Sep 17 00:00:00 2001 From: TheMeinerLP Date: Fri, 21 Aug 2026 20:13:59 +0200 Subject: [PATCH 2/4] chore(ci): add release-please, PR linting and release SBOMs - pr-lint.yml - commitlint.config.mjs - release-please simple mode, bootstrapped at 1.0.82 - release-please.yml with SBOM attached to the release --- .github/workflows/pr-lint.yml | 17 ++++++++++ .github/workflows/release-please.yml | 48 ++++++++++++++++++++++++++++ .release-please-manifest.json | 3 ++ commitlint.config.mjs | 3 ++ release-please-config.json | 12 +++++++ 5 files changed, 83 insertions(+) create mode 100644 .github/workflows/pr-lint.yml create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 commitlint.config.mjs create mode 100644 release-please-config.json diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml new file mode 100644 index 00000000..759b37b8 --- /dev/null +++ b/.github/workflows/pr-lint.yml @@ -0,0 +1,17 @@ +name: PR Lint + +# Conventional Commits on the PR title and every commit on the branch. +# release-please parses those commit types to decide the version bump and to +# build the changelog - a non-conventional commit silently produces neither. +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +permissions: + contents: read + pull-requests: read + +jobs: + lint: + uses: OneLiteFeatherNET/workflows/.github/workflows/pr-lint.yml@v2.8.1 + secrets: inherit diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 00000000..6e0e1ca0 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,48 @@ +name: Release + +# release-please collects Conventional Commits into a release PR; merging it +# tags the version and cuts the GitHub release. Everything that has to happen +# for a release is chained into this same run on purpose: release-please tags +# with GITHUB_TOKEN, and a tag pushed that way does NOT start a separate +# `on: push: tags` workflow. +on: + push: + branches: [main] + workflow_dispatch: +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + uses: OneLiteFeatherNET/workflows/.github/workflows/release-please.yml@v2.8.1 + secrets: inherit + + sbom: + name: Attach SBOM to release + needs: release-please + if: needs.release-please.outputs.release_created == 'true' + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + ref: ${{ needs.release-please.outputs.tag_name }} + + - name: Generate CycloneDX SBOM + uses: aquasecurity/trivy-action@v0.36.0 + with: + scan-type: fs + scan-ref: . + format: cyclonedx + output: bom.json + # An SBOM is an inventory, not a finding list - never fail on it. + exit-code: '0' + + - name: Attach SBOM to the release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ needs.release-please.outputs.tag_name }} + run: gh release upload "$TAG" bom.json --clobber diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..00064380 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.0.82" +} diff --git a/commitlint.config.mjs b/commitlint.config.mjs new file mode 100644 index 00000000..0616fb93 --- /dev/null +++ b/commitlint.config.mjs @@ -0,0 +1,3 @@ +export default { + extends: ['@commitlint/config-conventional'], +}; diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..f9d96e06 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "simple", + "include-component-in-tag": false, + "include-v-in-tag": true, + "packages": { + ".": { + "package-name": "PandorasCluster", + "changelog-path": "CHANGELOG.md" + } + } +} From 983a54bcf7a61c1f88dc8f6f73ef69a1af174f7e Mon Sep 17 00:00:00 2001 From: TheMeinerLP Date: Fri, 21 Aug 2026 20:18:42 +0200 Subject: [PATCH 3/4] chore(release): replace semantic-release with the chained release-please publish Both release systems would otherwise run on a push to main. release-please now owns tagging and the changelog; the publish that semantic-release ran as its publishCmd (./gradlew -Pversion= publish) is chained into the release-please run. --- .github/workflows/release-please.yml | 11 ++++++ .github/workflows/sematic-releases.yml | 50 -------------------------- .releaserc.json | 35 ------------------ 3 files changed, 11 insertions(+), 85 deletions(-) delete mode 100644 .github/workflows/sematic-releases.yml delete mode 100644 .releaserc.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 6e0e1ca0..d68c4388 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -18,6 +18,17 @@ jobs: uses: OneLiteFeatherNET/workflows/.github/workflows/release-please.yml@v2.8.1 secrets: inherit + publish: + name: Publish to OneLiteFeatherRepo + needs: release-please + if: needs.release-please.outputs.release_created == 'true' + uses: OneLiteFeatherNET/workflows/.github/workflows/gradle-publish.yml@v2.8.1 + with: + # Carries over what semantic-release used to run: + # ./gradlew -Pversion= publish + build-task: "build -Pversion=${{ needs.release-please.outputs.version }}" + publish-task: "publish -Pversion=${{ needs.release-please.outputs.version }}" + secrets: inherit sbom: name: Attach SBOM to release needs: release-please diff --git a/.github/workflows/sematic-releases.yml b/.github/workflows/sematic-releases.yml deleted file mode 100644 index 9248002c..00000000 --- a/.github/workflows/sematic-releases.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Release -"on": - push: - branches: - - main - - next - - beta - - "*.x" - -permissions: - contents: read # for checkout - -jobs: - release: - name: Release - runs-on: ubuntu-latest - permissions: - contents: write # to be able to publish a GitHub release - issues: write # to be able to comment on released issues - pull-requests: write # to be able to comment on released pull requests - id-token: write # to enable use of OIDC for npm provenance - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - fetch-depth: 0 - - name: Setup Node.js - uses: actions/setup-node@v7 - with: - node-version: "lts/*" - - name: Validate Gradle Wrapper - uses: gradle/actions/wrapper-validation@v6 - - name: Setup Java - uses: actions/setup-java@v5 - with: - distribution: temurin - java-version: 24 - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v6 - - name: Install dependencies - run: npm clean-install - - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies - run: npm audit signatures - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - ONELITEFEATHER_MAVEN_USERNAME: ${{ secrets.ONELITEFEATHER_MAVEN_USERNAME }} - ONELITEFEATHER_MAVEN_PASSWORD: ${{ secrets.ONELITEFEATHER_MAVEN_PASSWORD }} - run: npx semantic-release \ No newline at end of file diff --git a/.releaserc.json b/.releaserc.json deleted file mode 100644 index 16f81da3..00000000 --- a/.releaserc.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "plugins": [ - [ - "@semantic-release/commit-analyzer", - { - "preset": "conventionalcommits" - } - ], - "@semantic-release/release-notes-generator", - [ - "@semantic-release/exec", - { - "verifyConditionsCmd": "./gradlew check", - "publishCmd": "./gradlew -Pversion=${nextRelease.version} publish" - } - ], - "@semantic-release/git", - [ - "@semantic-release/github", - { - "assets": [ - { - "path": "build/libs/stardust.jar" - } - ], - "labels": false, - "failTitle": false, - "failComment": false, - "successComment": false, - "releasedLabels": false, - "addReleases": false - } - ] - ] -} \ No newline at end of file From 90b37b07943396f98919b2f9b476c25d8acb7399 Mon Sep 17 00:00:00 2001 From: TheMeinerLP Date: Fri, 21 Aug 2026 21:13:53 +0200 Subject: [PATCH 4/4] fix(ci): restore Renovate platform presets and anchor the version in build.gradle.kts - renovate flavor restored: paper - bootstrap-sha set from tag v1.0.82 --- release-please-config.json | 3 ++- renovate.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/release-please-config.json b/release-please-config.json index f9d96e06..83db3d51 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -8,5 +8,6 @@ "package-name": "PandorasCluster", "changelog-path": "CHANGELOG.md" } - } + }, + "bootstrap-sha": "bd207756f120a4b5d605d9f3363d5b70c75a7f00" } diff --git a/renovate.json b/renovate.json index b2e4bd3d..b73330b6 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,7 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "github>OneLiteFeatherNET/renovate:default(OneLiteFeatherNET/pandorascluster-maintainers)" + "github>OneLiteFeatherNET/renovate:default(OneLiteFeatherNET/pandorascluster-maintainers)", + "github>OneLiteFeatherNET/renovate:paper" ] }