Skip to content

[fix][build] Fix stage-release.sh for the Gradle build - #26017

Merged
lhotari merged 1 commit into
apache:masterfrom
lhotari:lh-fix-stage-release-gradle
Jun 13, 2026
Merged

lhotari merged 1 commit into
apache:masterfrom
lhotari:lh-fix-stage-release-gradle

Conversation

@lhotari

@lhotari lhotari commented Jun 13, 2026

Copy link
Copy Markdown
Member

Motivation

The release staging script src/stage-release.sh was left pointing at the Maven layout after the build migrated to Gradle, so it no longer works:

  • it called ./get-project-version.py, which was removed during the migration;
  • it copied the binary distributions from distribution/*/target/, but Gradle writes them to distribution/*/build/distributions/;
  • it copied an IO connectors distribution that the Gradle build no longer produces.

Modifications

  • Read the version from gradle.properties via get-pulsar-version.sh.
  • Copy the server, offloaders and shell binary distributions from the Gradle output directory build/distributions instead of the Maven target.
  • Drop the IO connectors copy; pulsar-connectors is released separately.

The source release is left unchanged: it is still produced by git archive of HEAD. Because .gitattributes declares no export-ignore, the archive contains every tracked file, which already covers everything needed to build from source (the Gradle wrapper and gradle-wrapper.jar, build-logic, settings.gradle.kts, gradle.properties, the version catalog and all module build files). No .gitignore/.gitattributes changes are required.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is build/release tooling and is not covered by automated tests. It was verified manually:

  • src/get-pulsar-version.sh returns the expected version from gradle.properties.
  • The generated source tarball (git archive of HEAD) was extracted and the Gradle build configured from the extract alone with ./gradlew help --offline, confirming the source release is self-contained.
  • The binary distribution paths match the Tar/Zip task outputs in distribution/{server,offloaders,shell}/build.gradle.kts (build/distributions/apache-pulsar[-offloaders|-shell]-$VERSION-bin.{tar.gz,zip}).

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

### Motivation

The release staging script `src/stage-release.sh` was left pointing at the
Maven layout after the build migrated to Gradle, so it no longer works:

- it called `./get-project-version.py`, which was removed during the migration;
- it copied the binary distributions from `distribution/*/target/`, but Gradle
  writes them to `distribution/*/build/distributions/`;
- it copied an IO connectors distribution that the Gradle build no longer
  produces.

### Modifications

- Read the version from `gradle.properties` via `get-pulsar-version.sh`.
- Copy the server, offloaders and shell binary distributions from the Gradle
  output directory `build/distributions` instead of the Maven `target`.
- Drop the IO connectors copy; `pulsar-connectors` is released separately.

The source release is unchanged: it is still produced by `git archive` of
`HEAD`, which already includes everything needed to build from source (the
Gradle wrapper, `build-logic`, `settings.gradle.kts`, `gradle.properties`, the
version catalog and all module build files). This was verified by extracting
the generated source tarball and configuring the build from it with
`./gradlew help --offline`.

Assisted-by: Claude Code (Opus 4.8)
lhotari added a commit that referenced this pull request Jun 13, 2026
The release staging script `src/stage-release.sh` was left pointing at the
Maven layout after the build migrated to Gradle, so it no longer works:

- it called `./get-project-version.py`, which was removed during the migration;
- it copied the binary distributions from `distribution/*/target/`, but Gradle
  writes them to `distribution/*/build/distributions/`;
- it copied an IO connectors distribution that the Gradle build no longer
  produces.

- Read the version from `gradle.properties` via `get-pulsar-version.sh`.
- Copy the server, offloaders and shell binary distributions from the Gradle
  output directory `build/distributions` instead of the Maven `target`.
- Drop the IO connectors copy; `pulsar-connectors` is released separately.

The source release is unchanged: it is still produced by `git archive` of
`HEAD`, which already includes everything needed to build from source (the
Gradle wrapper, `build-logic`, `settings.gradle.kts`, `gradle.properties`, the
version catalog and all module build files). This was verified by extracting
the generated source tarball and configuring the build from it with
`./gradlew help --offline`.

Assisted-by: Claude Code (Opus 4.8)
@lhotari lhotari added this to the 5.0.0-M1 milestone Jun 13, 2026
@lhotari
lhotari merged commit a7f6518 into apache:master Jun 13, 2026
157 of 163 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants