Skip to content
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

Add Maven publication #190

Merged
merged 4 commits into from
Sep 10, 2024
Merged

Add Maven publication #190

merged 4 commits into from
Sep 10, 2024

Conversation

snazy
Copy link
Member

@snazy snazy commented Aug 22, 2024

Adds publishing for Maven artifacts, including signing. Includes most prerequisites to publish Maven artifacts to Maven Central.

The build-code parts have been taken from Nessie, including the necessary special treatment of shadow-jars and support to publish a bom.
./gradlew publishToMavenLocal works out of the box.

On top of the Nessie parts, this change can also build a source tarball from using git archive, plus some Apache project specific adoptions.

Fully signed invocation example, assuming GPG agent (there are alternative ways to provide the GPG key+passphrase):

./ gradlew \
   publishToMavenLocal \
   sourceTarball \
   -Prelease \
   -PuseGpgAgent

This change also introduces a version.txt, which contains 999-SNAPSHOT. Using 999-SNAPSHOT on the main branch makes it easier later on to enable multiple major/minor version branches and releases from those. version.txt on a major/minor version branch would contain something like 2.1-SNAPSHOT. With 999-SNAPSHOT on the main branch eliminates the need to update version.txt on the main branch when a new major version branch is created, eliminating the need to commit and push to multiple branches from a mostly automated release workflow infrastructure.

@snazy snazy force-pushed the releases-prep branch 11 times, most recently from 6f6e7a1 to 789a379 Compare August 25, 2024 06:34
@snazy snazy mentioned this pull request Aug 26, 2024
@snazy snazy force-pushed the releases-prep branch 9 times, most recently from 55bc25d to ea160e8 Compare August 30, 2024 12:04
@snazy snazy force-pushed the releases-prep branch 4 times, most recently from e4e375d to 3b825fa Compare September 4, 2024 16:09
@snazy snazy marked this pull request as ready for review September 4, 2024 16:16
Adds publishing for Maven artifacts, including signing. Includes most prerequisites to publish Maven artifacts to Maven Central.

The build-code parts have been taken from Nessie, including the necessary special treatment of shadow-jars and support to publish a bom.
`./gradlew publishToMavenLocal` works out of the box.

On top of the Nessie parts, this change can also build a source tarball from using `git archive`, plus some Apache project specific adoptions.

Fully signed invocation example, assuming GPG agent (there are alternative ways to provide the GPG key+passphrase):
```bash
./ gradlew \
   publishToMavenLocal \
   sourceTarball \
   -Prelease \
   -PuseGpgAgent
```

This change also introduces a `version.txt`, which contains `999-SNAPSHOT`. Using `999-SNAPSHOT` on the `main` branch makes it easier later on to enable multiple major/minor version branches and releases from those. `version.txt` on a major/minor version branch would contain something like `2.1-SNAPSHOT`. With `999-SNAPSHOT` on the `main` branch eliminates the need to update `version.txt` on the `main` branch when a new major version branch is created, eliminating the need to commit and push to multiple branches from a mostly automated release workflow infrastructure.
@snazy
Copy link
Member Author

snazy commented Sep 5, 2024

@jbonofre can you review?


mailingLists.addAll("dev", "issues", "commits")

podlingPpmcAsfIds.addAll("anoop", "ashvin", "jackye", "russellspitzer", "snazy", "vvcephei")
Copy link
Member

Choose a reason for hiding this comment

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

I would add the mentors here (very selfish, but I would like to be on the list :) ).

Copy link
Member Author

Choose a reason for hiding this comment

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

It was a trick to verify that you review this change ;) ;) :disappear:

build.gradle.kts Outdated

repositories {
register("apache") {
this.nexusUrl // TODO configure
Copy link
Member

Choose a reason for hiding this comment

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

Do you mean https://repository.apache.org ?

It's used for staging and snapshots.
The stagingProfileId is the one from the release managers, or the release bot. Right ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd like to keep these as TODOs for now until we can actually test at least snapshot-releases e2e.
BTW: stagingProfileId isn't the user/bot (credentials are configured in a different way) - it's an ID "per-release".

@snazy snazy merged commit 99d8eb7 into apache:main Sep 10, 2024
3 checks passed
@snazy snazy deleted the releases-prep branch September 10, 2024 12:31
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