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 Github Actions workflows #39

Merged
merged 3 commits into from
Feb 19, 2021
Merged

Add Github Actions workflows #39

merged 3 commits into from
Feb 19, 2021

Conversation

amCap1712
Copy link
Contributor

@amCap1712 amCap1712 commented Feb 7, 2021

This PR adds GIthub Actions workflows to run CI tests and deploy the artifact to Maven Central. Currently, the PR does not add the steps to publish to Github Packages. This is because maven only allows a single repository in distributionManagement in the pom.xml. The standard approach to overcome this seems to be creating two different profiles, one for each repository to which package needs to be deployed to. I'll make the changes and update the PR accordingly.

A couple of administrative steps are needed in addition to the changes in the PR. First of all, Github Actions needs to be enabled on the repository. For using the release action, the following encrypted secrets need to be created as well.

  • MAVEN_USERNAME
  • MAVEN_PASSWORD
  • OSSRH_USERNAME
  • OSSRH_TOKEN

These secrets will probably be used by other Spdx projects as well. Hence, it might make sense to create these secrets at organization level. The steps for the same are detailed here.

Further, these steps need to be taken for being able to publish artifacts to Maven Central.

@goneall
Copy link
Member

goneall commented Feb 9, 2021

Thanks @amCap1712 ! I'll work on adding the secrets and testing this out later this week.

@goneall
Copy link
Member

goneall commented Feb 11, 2021

@amCap1712 Let's split this into 3 phases and 3 PR's:

  • Switch from Travis to Github Actions - same functionality as today, only using github actions rather than Travis
  • Switch the repository from Bintray to both Github Packages and Maven through OSSRH
  • Automate the release using deploy

Automating the release will require quite a bit more testing and I would only feel comfortable making that change after we had the first 2 steps working.

@goneall
Copy link
Member

goneall commented Feb 11, 2021

When replacing Travis with Actions, the following maven command should be run to execute the tests and provide coverage:

mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar

We should also change the Java version to Java 11

@amCap1712
Copy link
Contributor Author

@goneall I have updated the PR. The SONAR_TOKEN secret needs to be defined for running the SonarCloud check.

@goneall
Copy link
Member

goneall commented Feb 19, 2021

@amCap1712 I added the SONAR_TOKEN secret.

Reviewed the changes, looks good to me.

Should I go ahead and merge and try it out?

Copy link
Member

@goneall goneall left a comment

Choose a reason for hiding this comment

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

LGTM

@amCap1712
Copy link
Contributor Author

@goneall Thanks for the review. I think the PR is ready to be merged. Also, I have setup Github Actions on my fork for testing and demonstration. You can take a look at https://github.com/amCap1712/spdx-maven-plugin/actions to see how this changes will work in practice.

@goneall goneall merged commit ef959e9 into spdx:master Feb 19, 2021
@goneall
Copy link
Member

goneall commented Feb 19, 2021

@amCap1712 worked great! Thanks!

BTW - I've been trying to get the github actions working for the License-List-XML repo which has been a bit of a challenge due to the use of makefiles.

Would appreciate any input on the PR - I'm trying to figure out how to list all files changed for a given pull request, and haven't yet succeeded.

@amCap1712
Copy link
Contributor Author

@goneall Sure, I'll a look over the weekend and see if I can be of help.

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

2 participants