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

gh-actions: Refactor and combine build and release workflows. #48

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

kirkrodrigues
Copy link
Member

@kirkrodrigues kirkrodrigues commented Jun 25, 2024

Description

Currently, we have two workflows that are nearly identical except that one publishes to GitHub packages and the other publishes to Maven Central.

This PR consolidates them into one using GitHub's job conditionals. Specifically:

  1. On pushes to main, the build workflow will now build and publish to GitHub packages.
  2. On workflow triggers from a branch starting with "v", the build workflow will now build and publish to Maven Central.
  3. In all other cases, the workflow will only build and not publish.

This PR also:

  • Uses the env-var $GITHUB_REPOSITORY to determine where to publish the package (rather than the hard-coded y-scope/clp-ffi-java which would fail when used in forks).
  • Refactors the build commands to simply build, test, and package in one step rather than unnecessarily building the native library first.
  • Doesn't rerun the tests before publishing to Maven Central.

Validation performed

In my fork, validated that the workflows succeed in all 3 cases listed above.

Copy link
Member

@LinZhihao-723 LinZhihao-723 left a comment

Choose a reason for hiding this comment

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

Minor comment, otherwise lgtm. The commit msg should be good

@kirkrodrigues kirkrodrigues merged commit 0f6e1d6 into y-scope:main Jun 25, 2024
4 checks passed
@kirkrodrigues kirkrodrigues deleted the combine-build-workflows branch June 25, 2024 15:29
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