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

EMB-627 Added support for publishing, closing and releasing sonatype repositories #282

Merged
merged 17 commits into from
Jan 23, 2024

Conversation

cesarmax22
Copy link
Collaborator

Goal

Added the ability to:

  • publish to sonatype staging repository
  • close staging repository
  • release from staging repository to maven central

Modified workflow so we now have:

  • Pre-Release: this let us publish and close to staging sonatype repo. We can now smoke test
  • Release: this let us release to maven central

Testing

Release Notes

WHAT:

WHY:

WHO:

nelsitoPuglisi and others added 17 commits October 25, 2023 16:42
1- run Pre-Release for Smoke -> this step will run tests, it will publish to sonatype staging repo and it will close the repo. Now we are able to do some smoking testing
2- run Release -> once smoking test gets green light, we can release. This workflow performs the actual release to maven central. It will then set next version and push it remotely. It also generates documentation and pushes it to our docs repo.
@cesarmax22 cesarmax22 requested a review from a team as a code owner January 23, 2024 14:36
Copy link
Contributor

@fractalwrench fractalwrench left a comment

Choose a reason for hiding this comment

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

Nice, this should make our lives easier. For releasing, I like your idea of a pre-release workflow (that creates a snapshot we can test against) and a release workflow (that closes the snapshot).

Before we merge this I think it'd also be good to compare the POM + other artefacts this generates and check they are the same as what the old solution generates. This could be achieved by getting the files from maven local (~/.m2/repository/io) and eyeballing if there are any differences. I've been bitten in the past by POM files changing or artefacts going missing on upgrades like this.

Comment on lines +112 to +124
# measure-sdk-size:
# uses: embrace-io/android-size-measure/.github/workflows/analyze-sdk-size.yml@main
# needs: release
# with:
# sdk_version: ${{ github.event.inputs.current_version }}
# token: ${{ secrets.CD_GITHUB_TOKEN }}
#
# measure-startup-time:
# uses: embrace-io/android-sdk-benchmark/.github/workflows/macrobenchmark.yml@main
# needs: release
# with:
# sdk_version: ${{ github.event.inputs.current_version }}
# token: ${{ secrets.CD_GITHUB_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

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

If these are unused they can be deleted

@cesarmax22
Copy link
Collaborator Author

I compared all poms (okhttp, fcm, compose, sdk) and they're identical

@cesarmax22
Copy link
Collaborator Author

I did a quick testing on android-test-suite with the version generated by nexus-plugin and it seems to work fine

Copy link
Collaborator

@bidetofevil bidetofevil left a comment

Choose a reason for hiding this comment

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

Looks good to me as long as the way we are passing the token is a acceptable way of doing so. I know we typically want to avoid putting credentials in plain text in the URL but if this is a one off use thing or one of those that can't be reused in other contexts, then it's fine.

run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email '[email protected]'
git config --global url."https://${{ secrets.CD_GITHUB_USER }}:${{ secrets.CD_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this the accepted way of passing a token around for git to consume?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will create a ticket so we can revisit this

@cesarmax22 cesarmax22 merged commit c7b0bee into master Jan 23, 2024
2 checks passed
@cesarmax22 cesarmax22 deleted the nelson/nexus-plugin branch January 23, 2024 18:20
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.

None yet

5 participants