diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index fdb1491..4460638 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -1,25 +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: Setup Gradle - uses: gradle/actions/setup-gradle@v6 - - name: Build on ${{ matrix.os }} - run: ./gradlew clean build test \ 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.3.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..8bf0ec8 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.3.0 + secrets: inherit diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml deleted file mode 100644 index 2c01a1a..0000000 --- a/.github/workflows/main-build.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Main Branch Build - -on: - push: - branches: - - develop - - master - -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: Setup gradle - uses: gradle/actions/setup-gradle@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/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..c7c5301 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,34 @@ +name: Release + +on: + push: + branches: [main] + +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.3.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..f1c1e58 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.5.0" +} diff --git a/build.gradle.kts b/build.gradle.kts index 7292c34..c59afd8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } group = "net.theevilreaper" -version = "0.0.1" +version = "0.5.0" // x-release-please-version description = "Bounce" dependencies { diff --git a/buildSrc/src/main/kotlin/bounce.java-conventions.gradle.kts b/buildSrc/src/main/kotlin/bounce.java-conventions.gradle.kts index a6c4ba5..b19c610 100644 --- a/buildSrc/src/main/kotlin/bounce.java-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/bounce.java-conventions.gradle.kts @@ -4,7 +4,6 @@ plugins { java } -group = "net.theevilreaper" version = "0.0.1" java { diff --git a/gradle.properties b/gradle.properties index 377538c..93e1582 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,3 +3,4 @@ org.gradle.configuration-cache=true +group = net.theevilreaper diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..b0710a4 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,18 @@ +{ + "$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, + "pull-request-header": "", + "bootstrap-sha": "4838662c0ce839002d7d9106690e06d0f82a8284", + "packages": { + ".": { + "package-name": "bounce", + "release-type": "java", + "changelog-path": "CHANGELOG.md", + "extra-files": [ + { "type": "generic", "path": "build.gradle.kts" } + ] + } + } +}