Skip to content

feat(maven): Add maven target to deploy to Maven Central - #258

Merged
iker-barriocanal merged 111 commits into
masterfrom
iker/feat/maven-target
Jul 8, 2021
Merged

feat(maven): Add maven target to deploy to Maven Central#258
iker-barriocanal merged 111 commits into
masterfrom
iker/feat/maven-target

Conversation

@iker-barriocanal

@iker-barriocanal iker-barriocanal commented Jun 9, 2021

Copy link
Copy Markdown
Contributor

The goal of the new maven target is to automate the publishing of sentry-java (Android and Java) to Maven Central.

@iker-barriocanal iker-barriocanal self-assigned this Jun 9, 2021

@AbhiPrasad AbhiPrasad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good so far!

We might have to adjust the maven upload command to be a little more configurable but I think that’s a non-issue right now

Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/utils/mavenDeployment.ts Outdated
Comment thread src/utils/mavenDeployment.ts Outdated
Comment thread src/utils/mavenDeployment.ts Outdated
@iker-barriocanal iker-barriocanal changed the title feat(maven): Add mavent target to deploy to Maven Central feat(maven): Add maven target to deploy to Maven Central Jun 10, 2021

@AbhiPrasad AbhiPrasad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Last set of comments, will then wait for undraft to finish review

Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/utils/mavenDeployment.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
These credentials are the same as OSSRH credentials, so no need to have required duplicated vars.
Comment thread src/targets/maven.ts
Comment on lines +179 to +183
// Maven central is very flaky, so retrying with an exponential delay in
// in case it fails.
await retrySpawnProcess(this.mavenConfig.gradleCliPath, [
'closeAndReleaseRepository',
]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

right now a Gradle plugin does it (close and promote the releases): https://github.com/vanniktech/gradle-maven-publish-plugin/tree/master/src/main/kotlin/com/vanniktech/maven/publish/nexus

if we do those HTTP requests directly via Craft, we could remove the Gradle plugin for good.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's no support for the Gradle plugin yet, it will be supported at a later stage. This is targeting https://github.com/getsentry/sentry-java.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

that's not really related to our sentry android gradle plugin, but rather the graadle plugin that calls closeAndReleaseRepository.
if we replicate what that plugin does via craft, we can eliminate the usage of 3rd party plugins to release our things

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the maven cli does not have the ability to close the repo and promote the releases on sonatype, thats why we use this plugin, otherwise, we'd need to do it manually.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a TODO, we can address this later.

@iker-barriocanal
iker-barriocanal requested a review from BYK July 7, 2021 09:41

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should probably add a todo somewhere about updating the Docker image to include the necessary binaries?

Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/maven.ts
Comment thread src/targets/maven.ts
Comment thread src/utils/__tests__/async.test.ts
@iker-barriocanal
iker-barriocanal enabled auto-merge (squash) July 8, 2021 09:59

@AbhiPrasad AbhiPrasad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good

Comment thread src/targets/__tests__/maven.test.ts
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
@iker-barriocanal
iker-barriocanal merged commit 6109727 into master Jul 8, 2021
@iker-barriocanal
iker-barriocanal deleted the iker/feat/maven-target branch July 8, 2021 12:30
iker-barriocanal added a commit that referenced this pull request Jul 12, 2021
The goal of the `symbol-collector` target is to continue automating the release of [`sentry-java`](https://github.com/getsentry/sentry-java) (Android and Java). #258 automated publishing to Maven Central, and this PR automates uploading symbols to the Android Bucket.
@BYK BYK added this to the Added Maven Target milestone Sep 14, 2021
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.

6 participants