From 7b3129468f9d9ae65d888f78226dbc6386cea015 Mon Sep 17 00:00:00 2001 From: TheMeinerLP Date: Fri, 21 Aug 2026 19:15:40 +0200 Subject: [PATCH 1/4] chore(ci): adopt shared workflows and central Renovate preset - renovate.json -> central preset (aves-maintainers) - security.yml (Trivy + CycloneDX SBOM) - build-pr.yml (gradle-build-pr, Java 25, 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 | 38 ++++++++--------- .github/workflows/close_invalid_prs.yml | 12 ++---- .github/workflows/security.yml | 55 +++++++++++++++++++++++++ renovate.json | 23 ++++++----- 4 files changed, 88 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/security.yml diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index e7ed27a6..7b3727c4 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -1,23 +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: 25 - - name: Build on ${{ matrix.os }} - run: ./gradlew clean build \ No newline at end of file + 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: "25" + 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 8601a3c1..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 == 'develop' }} - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: "Please do not open pull requests from the `develop` 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..d96e6bf4 --- /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: [develop] + schedule: + - cron: "46 6 * * 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 094436a4..14bc65d3 100644 --- a/renovate.json +++ b/renovate.json @@ -1,8 +1,17 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "github>OneLiteFeatherNET/renovate:default(OneLiteFeatherNET/aves-maintainers)", - "github>OneLiteFeatherNET/renovate:minestom" + "github>OneLiteFeatherNET/renovate:default(OneLiteFeatherNET/aves-maintainers)" + ], + "packageRules": [ + { + "matchPackageNames": [ + "net.theevilreaper:aves" + ], + "registryUrls": [ + "https://repo.onelitefeather.dev/onelitefeather" + ] + } ], "customManagers": [ { @@ -16,13 +25,5 @@ "datasourceTemplate": "maven", "depNameTemplate": "net.theevilreaper:aves" } - ], - "packageRules": [ - { - "matchPackageNames": ["net.theevilreaper:aves"], - "registryUrls": [ - "https://repo.onelitefeather.dev/onelitefeather" - ] - } ] -} \ No newline at end of file +} From 1e872d410ab80a830d6fef105177adf425704bbc Mon Sep 17 00:00:00 2001 From: TheMeinerLP Date: Fri, 21 Aug 2026 20:15:51 +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.16.3 - 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..e8c2ce01 --- /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: [develop] + 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..b59e63d0 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.16.3" +} 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..5cf81605 --- /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": "Aves", + "changelog-path": "CHANGELOG.md" + } + } +} From b72c69218645f188eaf208a1e0eafbe9a5aece87 Mon Sep 17 00:00:00 2001 From: TheMeinerLP Date: Fri, 21 Aug 2026 20:16:12 +0200 Subject: [PATCH 3/4] chore(ci): publish from the release-please run instead of a tag trigger release-please tags with GITHUB_TOKEN, and a tag pushed that way does not start an `on: push: tags` workflow - so the old publish workflow would never have fired on a release. Chain the publish into the release-please run, gated on release_created. --- .github/workflows/publishing.yaml | 25 ------------------------- .github/workflows/release-please.yml | 11 +++++++++++ 2 files changed, 11 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/publishing.yaml diff --git a/.github/workflows/publishing.yaml b/.github/workflows/publishing.yaml deleted file mode 100644 index 6313cd76..00000000 --- a/.github/workflows/publishing.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: Publish JAR - -on: - push: - tags: - - '**' -jobs: - build: - runs-on: ubuntu-latest - env: - ONELITEFEATHER_MAVEN_USERNAME: ${{ secrets.ONELITEFEATHER_MAVEN_USERNAME }} - ONELITEFEATHER_MAVEN_PASSWORD: ${{ secrets.ONELITEFEATHER_MAVEN_PASSWORD }} - steps: - - name: Checkout repository - uses: actions/checkout@v7 - - - name: Set up JDK 25 - uses: actions/setup-java@v5 - with: - distribution: 'temurin' - java-version: '25' - - name: Build with Gradle - run: ./gradlew build - - name: Publish to Maven - run: ./gradlew publish diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index e8c2ce01..1b03731e 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: + java-version: "25" + java-distribution: "temurin" + publish-task: "publish" + secrets: inherit sbom: name: Attach SBOM to release needs: release-please From c2f84205d940cb98c23bfe97e331e4ac199ea015 Mon Sep 17 00:00:00 2001 From: TheMeinerLP Date: Fri, 21 Aug 2026 21:11:49 +0200 Subject: [PATCH 4/4] fix(ci): restore Renovate platform presets and anchor the version in build.gradle.kts - renovate flavor restored: minestom - marker added to the existing version literal; extra-files now points at build.gradle.kts - bootstrap-sha set from tag 1.16.3 --- build.gradle.kts | 2 +- release-please-config.json | 11 +++++++++-- renovate.json | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 211c05be..f5fdb698 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } group = "net.theevilreaper" -version = "1.16.3" +version = "1.16.3" // x-release-please-version description = "Aves" java { diff --git a/release-please-config.json b/release-please-config.json index 5cf81605..c3c4201d 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -6,7 +6,14 @@ "packages": { ".": { "package-name": "Aves", - "changelog-path": "CHANGELOG.md" + "changelog-path": "CHANGELOG.md", + "extra-files": [ + { + "type": "generic", + "path": "build.gradle.kts" + } + ] } - } + }, + "bootstrap-sha": "d997039dafcfa327129a07b6137a9f6ea84bcb89" } diff --git a/renovate.json b/renovate.json index 14bc65d3..eee412d4 100644 --- a/renovate.json +++ b/renovate.json @@ -1,7 +1,8 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "github>OneLiteFeatherNET/renovate:default(OneLiteFeatherNET/aves-maintainers)" + "github>OneLiteFeatherNET/renovate:default(OneLiteFeatherNET/aves-maintainers)", + "github>OneLiteFeatherNET/renovate:minestom" ], "packageRules": [ {