From 53e3310853e840f5db6c20cc95cd6db31ad4ddba Mon Sep 17 00:00:00 2001 From: TheMeinerLP Date: Tue, 14 Jul 2026 11:10:13 +0200 Subject: [PATCH 1/2] chore: migrate release automation to Release-Please + reusable workflows --- .github/workflows/build-pr.yml | 35 +++++++++++-------------- .github/workflows/close_invalid_prs.yml | 15 +++++------ .github/workflows/main-build.yml | 30 --------------------- .github/workflows/publish.yml | 26 ------------------ .github/workflows/release-drafter.yml | 24 ----------------- .github/workflows/release-please.yml | 34 ++++++++++++++++++++++++ .release-please-manifest.json | 3 +++ build.gradle.kts | 2 +- release-please-config.json | 17 ++++++++++++ 9 files changed, 77 insertions(+), 109 deletions(-) delete mode 100644 .github/workflows/main-build.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release-drafter.yml create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index e7ed27a..6cb03d4 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -1,23 +1,18 @@ name: Build PR + 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: + # Reuse the OneLiteFeather org build workflow (Java 25, OS matrix, tests, coverage). + uses: OneLiteFeatherNET/workflows/.github/workflows/gradle-build-pr.yml@v2.4.0 + 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 8601a3c..e69963a 100644 --- a/.github/workflows/close_invalid_prs.yml +++ b/.github/workflows/close_invalid_prs.yml @@ -2,13 +2,12 @@ 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.4.0 + with: + protected-branch: "develop" + comment: "Please do not open pull requests from the `develop` branch, create a new branch instead." + secrets: inherit diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml deleted file mode 100644 index 5e1bcad..0000000 --- a/.github/workflows/main-build.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Main Branch Build - -on: - push: - branches: - - develop - -jobs: - build_and_test: - if: github.repository_owner == 'OneLiteFeatherNET' - name: Build and Test - 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: Validate Gradle Wrapper - uses: gradle/actions/wrapper-validation@v6 - - name: Setup Java - uses: actions/setup-java@v5 - with: - distribution: temurin - java-version: 25 - - name: Build on ${{ matrix.os }} - run: ./gradlew test \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 34363b6..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,26 +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 21 - uses: actions/setup-java@v5 - with: - distribution: 'temurin' - java-version: '25' - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v6 - - name: Build with Gradle - run: ./gradlew build - - name: Publish to Maven - run: ./gradlew publish \ No newline at end of file diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index 01b8ad9..0000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: draft release -on: - push: - branches: - - master - - main - - develop - pull_request: - types: [opened, reopened, synchronize] - pull_request_target: - types: [opened, reopened, synchronize] -permissions: - contents: read -jobs: - update_release_draft: - permissions: - contents: write - pull-requests: write - if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} - runs-on: ubuntu-latest - steps: - - uses: release-drafter/release-drafter@v7 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..d309625 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,34 @@ +name: Release + +on: + push: + branches: [develop] + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + version: ${{ steps.release.outputs.version }} + steps: + - name: Run release-please + id: release + uses: googleapis/release-please-action@v5 + with: + config-file: release-please-config.json + manifest-file: .release-please-manifest.json + + 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.4.0 + with: + java-version: "25" + publish-task: "publish" + secrets: inherit diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..b28fea9 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.9.1" +} diff --git a/build.gradle.kts b/build.gradle.kts index da455a9..83d9975 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } group = "net.onelitefeather" -version = "0.9.1" +version = "0.9.1" // x-release-please-version java { toolchain { diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..b632b9b --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "simple", + "include-component-in-tag": false, + "include-v-in-tag": false, + "pull-request-header": "", + "bootstrap-sha": "8ac2aea2d469e13ae600ec1e9d930b33adc3f99f", + "packages": { + ".": { + "package-name": "guira", + "changelog-path": "CHANGELOG.md", + "extra-files": [ + { "type": "generic", "path": "build.gradle.kts" } + ] + } + } +} From 12aea0fa92015d6f88d5eb188259fc2927af730b Mon Sep 17 00:00:00 2001 From: theEvilReaper Date: Tue, 14 Jul 2026 16:16:01 +0200 Subject: [PATCH 2/2] feat(release): add changelog file --- CHANGELOG.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29