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

A possible stub for publishing the LF internal model/AST to Github Pak. #1211

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Rojods
Copy link

@Rojods Rojods commented Jun 2, 2022

This is a small stub to help a bit with the issue opened in #937 . I am fairly certain that if any necessary jars/modules are published in Github Packages, the outcome is just as good as doing it for Maven central. Plus, it seems like Github Packages requires less setting up than maven central (e.g. no need for given GPG key).

Since I am not an expert on the infrastructure surrounding LF, I've tried my best to use GH's stub publishing along the other GH actions I saw in the repo. Hopefully it does not destroy anything but gives an almost correct workflow to publish the model/AST jars to GH's packages.

The tests still all passed, minus the repo_token one. I could not find a proper branch to try to merge in to, so I leave master for now. If this is inappropriate, I can change the request.

Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

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

This looks pretty cool! I left some comments...

on:
workflow_dispatch:
release:
types: [created]
Copy link
Member

Choose a reason for hiding this comment

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

I think this means it will also be triggered by the nightly build. Was this the intent? I'm thinking we should probably exclude nightly.

Copy link
Author

Choose a reason for hiding this comment

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

Oh my! Absolutely. nightly could be included as a maven package (always published online with a SNAPSHOT or nightly but I think it would require certain knowledge of the inner workings of this infrastructure to override old jars. Let's just follow your suggestion for now and exclude nightly for simplicity.

- name: Prepare build environment
uses: ./.github/actions/prepare-build-env
- name: Publish package
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
Copy link
Member

Choose a reason for hiding this comment

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

Why use this specific hash? Maybe just use v2.1.7?

Copy link
Author

Choose a reason for hiding this comment

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

In my excitement I just put what the GH actions gradle tutorial gave me. I fully agree with your suggestion.

- name: Publish package
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
with:
arguments: org.lflang:publish
Copy link
Member

Choose a reason for hiding this comment

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

What gets published as a result of this action, exactly? Is there a way to do a dry run and find out?

Copy link
Author

Choose a reason for hiding this comment

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

I am not sure if there is a way to do a dry-run of this, sadly. I know a tool that can simulate all github actions offline. But I guess we don't get the GITHUB_TOKEN that is injected in the containers that run all actions.

In theory this this command would publish the jar that is generated from the org.lflang submodule of the repo. It might need some adjustment when it comes to the dependencies of the MWE2 plugins are doing them proper, but I guess it is not much extra work!

In any case, I think the only way to see if this is working is to get the developer machine (you, @lhstrh?) and try to upload the jars to GH packages. This is the default flow for Maven Central so I am not sure if it can be replicated. I will try to check it.

Copy link
Member

Choose a reason for hiding this comment

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

OK, thanks! I'll tinker with this.

@Rojods
Copy link
Author

Rojods commented Jun 3, 2022

I have now put conditionals in the action so that it "ignores" nightly. For the moments it was the best solution I could think of, since the event trigger release does not seem to support filter like push does. I think it will work out even though it might feel a bit hackish.

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