CinRC / IRDC-CCSK

Java implementation of distributed reversible computation verification
https://spots.augusta.edu/caubert/cinrc/
GNU General Public License v3.0
4 stars 2 forks source link

Use workflow to compile remotely #30

Closed aubertc closed 1 year ago

aubertc commented 1 year ago

It would be nice to use github's workflow to release packages every time a push / major release is made, and to have instructions on how to simply download the .jar and execute it in the readme.

What do you think? I'm a bit familiar with it, so I can take care of it if you prefer, or we can work on it together.

aubertc commented 1 year ago

(I'm also saying that because I have X versions of java and Y versions of maven, and it's a bit of a pain to juggle between them ;-) )

peterbro1 commented 1 year ago

I did some experimenting and have a workflow I tried to set up in the ci_test branch, but am unable to get it to compile properly. Perhaps you could take a look? The problem is with this line:

- name: Set versions run: echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV For some reason, it returns "1", when the project.version variable (executing the command manually) returns 2.92 as it should. Also, running the mvn help:evaluate -Dexpression=project.version -q -DforceStdout command in powershell crashes with this error:

[ERROR] Unknown lifecycle phase ".version". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]

whereas running it in bash or cmd simply returns 2.92. I have no idea what the issue is.

peterbro1 commented 1 year ago

Update:

It builds and compiles fine, but it cannot get the upload url. You can see where it failed here:

https://github.com/peterbro1/IRDC-CCSK/actions/runs/3414092284

aubertc commented 1 year ago

Mmmmh… Can I think out loud?

The logs say:

RequestError [HttpError]: Not Found
    at /home/runner/work/_actions/bruceadams/get-release/v1.3.2/dist/index.js:4251:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/bruceadams/get-release/v1.3.2/dist/index.js:9534:32) {
  status: 404,
  response: {
    url: 'https://api.github.com/repos/peterbro1/IRDC-CCSK/releases/tags/refs%2Fheads%2Fmaster',
    status: 404,

rightfully so, since there is no master release.

What we want to fetch is https://api.github.com/repos/peterbro1/IRDC-CCSK/releases/tags/2.95 which responds correctly.

However, the action should query the latest version correctly, since you set the tag correctly:

https://github.com/peterbro1/IRDC-CCSK/blob/8e0e2b153d25ec35513e55f4561a36b2798f8d7e/.github/workflows/auto-build.yml#L67

My guess at this point is that something is off with the action you are using, and that we should read its doc.

aubertc commented 1 year ago

Maybe we should use bruceadams/get-release@v1.3.2 instead of actions/create-release@v1, as in this example?

aubertc commented 1 year ago

actions/create-release@v1 is archived, so it may not work properly. This would be my guess: replace this action with a more modern one. Can I let you explore this, @peterbro1 ?

My thinking is up there, so if I am wrong please do point it out!

aubertc commented 1 year ago

What is off is that actions/create-release@v1 seems to work (there are some deprecated warnings, but ok), but that it is bruceadams/get-release@v1.3.2 that chokes, even if it seems (to me) properly set up.

aubertc commented 1 year ago

According to this doc for get-release, we can (should?) add a tag name (like I did in this fork), but the error message remains the same.

I'll let you investigate for now, and it's fine to come back stating "I have no idea, keep trying for me please"!

aubertc commented 1 year ago

I believe this can be closed?