From d5c16731eb17c1489af8072b751cbf9b9b375070 Mon Sep 17 00:00:00 2001 From: Lukas Jost Date: Mon, 12 Oct 2026 20:44:14 +0200 Subject: [PATCH 1/2] ci: bootstrap Release Please for BuildSystem artifacts --- .github/workflows/release-please.yml | 27 +++++++++++++++++++++++++++ .release-please-manifest.json | 3 +++ GROUNDS.md | 16 ++++++++++++++++ release-please-config.json | 11 +++++++++++ version.txt | 1 + 5 files changed, 58 insertions(+) create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json create mode 100644 version.txt diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..e1b295a --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,27 @@ +name: Release Please + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: write + issues: write + pull-requests: write + +concurrency: + group: release-please-${{ github.ref }} + cancel-in-progress: false + +jobs: + release-please: + runs-on: ubuntu-24.04-arm + timeout-minutes: 10 + steps: + - name: Create or update the release PR + uses: googleapis/release-please-action@v5 + with: + token: ${{ secrets.RELEASE_PLEASE_TOKEN }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..d2f93b6 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "4.0.0-grounds.16" +} diff --git a/GROUNDS.md b/GROUNDS.md index b10a58c..d7ea7a7 100644 --- a/GROUNDS.md +++ b/GROUNDS.md @@ -309,3 +309,19 @@ a token minted by one cluster does not verify against the other's JWKS. in which a tick could write a region file mid-archive. The complete fix is to unload the world, pack it, and load it back; that is more disruptive to a builder standing in it, and worth doing once pushes are frequent enough for the risk to be real. + +## Release ownership + +Release Please owns Grounds version bumps, release PRs, tags and GitHub releases. +The initial manifest and `version.txt` record the existing +`v4.0.0-grounds.16` release, not a new version. The bootstrap SHA is that tag's +commit, so the first release PR includes the subsequent Grounds changes. +Release Please calculates the next version from conventional commits; do not +create tags or releases manually. + +The organization `RELEASE_PLEASE_TOKEN` must remain available to this repository. +Unlike `GITHUB_TOKEN`, it allows release-PR checks and the existing tag-triggered +`release.yml` artifact build to run. After a reviewed release PR is merged, +`release.yml` builds with the tag version and attaches both `BuildSystem` and +`GroundsMaps` JARs. Upstream `gradle.properties` and the Sonatype workflow remain +unchanged. Release publication does not deploy or restart the build server. diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..11bd8a0 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "bootstrap-sha": "e5594304c75cfc1f0e5f203033b5dce8d272dc69", + "packages": { + ".": { + "release-type": "simple", + "package-name": "buildsystem", + "include-component-in-tag": false + } + } +} diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..27e7651 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +4.0.0-grounds.16 From 2920f1f4c39e56ebaabf717136a7a7649f263d97 Mon Sep 17 00:00:00 2001 From: Lukas Jost Date: Mon, 12 Oct 2026 20:47:12 +0200 Subject: [PATCH 2/2] ci: attach artifacts only after Release Please publication --- .github/workflows/release.yml | 35 +++++++++++++++++++++-------------- GROUNDS.md | 10 ++++++---- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d6ffd5..81758fa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,11 @@ name: Release # Ours, not upstream's. `publish.yml` next door pushes upstream's coordinates to Sonatype and is -# fenced to their owner id, so it can never fire here — this builds the two jars a build server -# actually installs and attaches them to a GitHub release. +# fenced to their owner id, so it can never fire here. Release Please creates the release; +# this workflow only attaches the two jars a build server actually installs. on: - push: - tags: [ 'v*' ] + release: + types: [published] permissions: contents: write @@ -13,11 +13,14 @@ permissions: jobs: release: + if: startsWith(github.event.release.tag_name, 'v') runs-on: ubuntu-24.04-arm steps: - name: Checkout Git Repository uses: actions/checkout@v7 + with: + ref: ${{ github.event.release.tag_name }} - name: Set up JDK 25 uses: actions/setup-java@v5 @@ -30,7 +33,9 @@ jobs: - name: Version from the tag id: version - run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" + env: + RELEASE_TAG: ${{ github.event.release.tag_name }} + run: printf 'version=%s\n' "${RELEASE_TAG#v}" >> "$GITHUB_OUTPUT" # -Pversion rather than an edit to gradle.properties: that file belongs to upstream, and # every line of it we change is a line a future merge has to argue about. @@ -38,13 +43,15 @@ jobs: env: GITHUB_ACTOR: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./gradlew clean build -Pversion=${{ steps.version.outputs.version }} + RELEASE_VERSION: ${{ steps.version.outputs.version }} + run: ./gradlew clean build "-Pversion=$RELEASE_VERSION" - - name: Release - uses: softprops/action-gh-release@v2 - with: - name: ${{ github.ref_name }} - generate_release_notes: true - files: | - build/libs/BuildSystem-${{ steps.version.outputs.version }}.jar - build/libs/GroundsMaps-${{ steps.version.outputs.version }}.jar + - name: Attach artifacts to the existing Release Please release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + RELEASE_TAG: ${{ github.event.release.tag_name }} + run: | + gh release upload "$RELEASE_TAG" \ + "build/libs/BuildSystem-${RELEASE_TAG#v}.jar" \ + "build/libs/GroundsMaps-${RELEASE_TAG#v}.jar" diff --git a/GROUNDS.md b/GROUNDS.md index d7ea7a7..69f7dd3 100644 --- a/GROUNDS.md +++ b/GROUNDS.md @@ -320,8 +320,10 @@ Release Please calculates the next version from conventional commits; do not create tags or releases manually. The organization `RELEASE_PLEASE_TOKEN` must remain available to this repository. -Unlike `GITHUB_TOKEN`, it allows release-PR checks and the existing tag-triggered -`release.yml` artifact build to run. After a reviewed release PR is merged, -`release.yml` builds with the tag version and attaches both `BuildSystem` and -`GroundsMaps` JARs. Upstream `gradle.properties` and the Sonatype workflow remain +Unlike `GITHUB_TOKEN`, it allows release-PR checks and the `release.published` +artifact build to run. After a reviewed release PR is merged, Release Please +publishes the release; `release.yml` checks out its exact tag, builds with that +version and attaches both `BuildSystem` and `GroundsMaps` JARs without creating +another release or changing its notes. Existing assets are not overwritten. +Upstream `gradle.properties` and the Sonatype workflow remain unchanged. Release publication does not deploy or restart the build server.