Skip to content

Clean Up CI - Add GH Action to Publish to Maven Central #1757

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

Closed
TomGranot opened this issue Dec 19, 2020 · 3 comments
Closed

Clean Up CI - Add GH Action to Publish to Maven Central #1757

TomGranot opened this issue Dec 19, 2020 · 3 comments
Assignees

Comments

@TomGranot
Copy link
Contributor

TomGranot commented Dec 19, 2020

So now that #1746 is done, time to think about what actually happens when a merge happens to master to the repo, this time in the world of GitHub Actions.

Rationale

In the current version of .travis.yml, a small script (before_script.sh) checks whether this is a PR build or a merge to master, and decides whether to run another script (make_credentials.py).

That script, in turn, inserts a few secrets (kept as environment variables on Travis, so we won't have to check them into source control) into the agent's .m2/settings.xml file. This is done as preparation for publishing to Maven Central (see here for a bit more context), which is then done in the after_success.sh script.

However, it seems thatbefore_script.sh, make_credentials.py and after_success.sh are all redundant when using GH Actions. The setup-java@1 appears to support this exact XML fun out of the box.

In Practice

What would replicating the full .travis.yml look like in GH actions, then?

Like this: #1758

Note that in the current Travis-based version, every time Travis builds master the deploy lifecycle phase is being run. That means that on every merge to master, a deployment to Maven is made - regardless of an actual release.

To be continued - If anyone has a bit of experience doing this type of migration, feel free to chime in. (@RahulKushwaha I'm looking at you :) )

@TomGranot TomGranot changed the title Add GH Action to Publish to Maven Central Clean Up CI - Add GH Action to Publish to Maven Central Dec 19, 2020
@TomGranot TomGranot self-assigned this Dec 19, 2020
@RahulKushwaha
Copy link

RahulKushwaha commented Dec 21, 2020

@TomGranot: I have not done this before, but lemme take a look at this. Did you already get this working?

@TomGranot
Copy link
Contributor Author

@RahulKushwaha Sort of, but coming to think about it - it's going to be hard for you to test without the username & password (or some sort of staging environment on the Maven Central side). I think it's better if you take a look at #1756 instead - mentioning you there.

@hyperxpro
Copy link
Member

Successfully migrated to GitHub Actions.

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

No branches or pull requests

3 participants