Skip to content

Simplify Gradle build logic for making releases. #700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

blackwinter
Copy link
Member

@blackwinter blackwinter commented Jun 24, 2025

Resolves #684.

Release and release candidate builds require a clean working directory and a matching tag: Create a tag for the release version first, then execute whatever build target you need with the corresponding version specified as project property (-PpublishVersion=A.B.C or -PpublishVersion=A.B.C-rcN). Release builds additionally enforce signing of the generated artifacts.

Ad hoc builds from branches (including master) or arbitrary "version" designators always result in SNAPSHOT builds and don't require a clean working directory or a matching tag: Specify the desired "version" as project property (-PpublishVersion=A-B-C-SNAPSHOT) or simply omit it (will then use the current branch name).

Behavioural changes:

  • Release candidates use tags instead of branches, just like regular releases.
  • Release candidates require a clean working directory, just like regular releases.
  • Publish version must be passed explicitly, it's no longer inferred from repository state and/or tags.
  • Ad hoc builds ignore tags altogether (no need to fake a dirty working directory in order to work around the previous build logic).
  • Branch names don't carry any meaning (previously releases/* for release builds and *-rc* for release candidates).
  • Aborts the build instead of warning/skipping if any preconditions aren't met (i.e. working directory state, matching tag).

Release and release candidate builds require a clean working directory and a matching tag: Create a tag for the release version first, then execute whatever build target you need with the corresponding version specified as project property (`-PpublishVersion=A.B.C` or `-PpublishVersion=A.B.C-rcN`). Release builds additionally enforce signing of the generated artifacts.

Ad hoc builds from branches (including `master`) or arbitrary "version" designators always result in SNAPSHOT builds and don't require a clean working directory or a matching tag: Specify the desired "version" as project property (`-PpublishVersion=A-B-C-SNAPSHOT`) or simply omit it (will then use the current branch name).
@blackwinter blackwinter force-pushed the 684-simplifyGradleBuildLogic branch from dfee37c to ab7f368 Compare June 25, 2025 09:26
Copy link
Member

@dr0i dr0i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides he empty line I think this is good 👍

@dr0i dr0i removed their assignment Jul 1, 2025
@dr0i dr0i removed their assignment Jul 1, 2025
@TobiasNx
Copy link
Contributor

@blackwinter can you help me how to review this? what should I try to run?

@TobiasNx TobiasNx assigned blackwinter and unassigned TobiasNx Jul 14, 2025
@blackwinter
Copy link
Member Author

First of all, you should review the updated steps in MAINTAINING.md. Do they make sense to you? Are they sufficiently simple, fool-proof, without providing too many opportunities for mistakes?

Then you could run various scenarios (without actually pushing/publishing anything!). Different branches/detached head, different publishVersions, with and without providing the required tags (which should be cleaned up afterwards!). The most basic task would be clean which then just prints the version; you could also generate the distribution with assemble.

If you need more guidance we should meet for a "review session".

@blackwinter blackwinter assigned TobiasNx and unassigned blackwinter Jul 14, 2025
In order to minimize risk of injection attacks.
@blackwinter blackwinter requested a review from TobiasNx July 18, 2025 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review
Development

Successfully merging this pull request may close these issues.

Simplify Gradle build logic.
3 participants