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

Make jar available from Github? #557

Closed
mfhepp opened this issue May 13, 2021 · 23 comments · Fixed by #560
Closed

Make jar available from Github? #557

mfhepp opened this issue May 13, 2021 · 23 comments · Fixed by #560

Comments

@mfhepp
Copy link

mfhepp commented May 13, 2021

Could you please make the binary / jar also available as a download from the Github repository? Currently, you can only fetch it from Sourceforce. As Sourceforce was under a lot of heat for adding Adware to downloads, I would very much prefer to avoid that detour.

It should just be a few clicks to add the .jar to the releases, as described here, or automatically as a Github Action.

Thanks in advance!

@ldeluigi
Copy link

By the way... https://nav.dl.sourceforge.net/project/plantuml/plantuml.jar doesn't work anymore

@ldeluigi
Copy link

Now the direct link seems to be changed to https://netcologne.dl.sourceforge.net/project/plantuml/plantuml.jar

@ldeluigi
Copy link

Sourceforge policies should be overcome by making the jar available here on github...

@arnaudroques
Copy link
Contributor

It should just be a few clicks to add the .jar to the releases, as described here, or automatically as a Github Action.

Well, we are willing to do it automatically as a Github Action, but we have no idea on how to do that.

Could anyone help on this subject ? Any PR would be welcome :-)

@matthew16550
Copy link
Collaborator

@arnaudroques I'll have a go at that now

@matthew16550
Copy link
Collaborator

@arnaudroques I think we could use this as the release process but haven't actually tried it yet:

  • Create a DRAFT release via GitHub UI
  • The new GitHub Action will auto run
    • Checkout THE_RELEASE_TAG
    • mvn versions:set THE_RELEASE_TAG (because usually it's a -SNAPSHOT at this point)
    • mvn package
    • Upload plantuml-THE_RELEASE_TAG.jar to the Release
    • Publish the Release

Kind of a kludge because it ignores that maven-release-plugin is already managing releases via Sourceforge but it's simpleish to understand. Does it make sense to try this as a first attempt?

Alternatively we could look at maven-release-plugin updating Git so there is an obvious commit that has the POM version set to the release tag.

@arnaudroques
Copy link
Contributor

Does it make sense to try this as a first attempt?

Yes, it sounds good.
Can you clone this repository to make your tries and tell us the result then ?

Thanks for your help !

@matthew16550
Copy link
Collaborator

So the draft idea doesn't work because it seems that events are not being fired for draft releases 😢, see:

But I have it working in #560 with jars auto added to releases just after they have been published.

@ldeluigi
Copy link

ldeluigi commented May 23, 2021 via email

@matthew16550
Copy link
Collaborator

The correct way would be to react to a new tag event based on semantic versioning and generate a new release with everything you need generated by CI (that is executables/packages and documentation usually). The changelog can be generated by commit history OR can be read from a file. There are actions that take care of every step of this process

I agree something like that would be a cleaner long term solution but there's quite a few changes needed to get there.

Currently development is driven from Subversion in SourceForge and GitHub sort of follows along behind (except for PRs!).

PlantUML tends to evolve in small steps, #560 solves the immediate itch by making JARs available in GitHub and it gives us some experience with workflows publishing artefacts but it doesn't force a rethink of any other part of the dev / release process.

Longer term, my 2c vote would be to stop using Subversion / SourceForge and move all work to GitHub then a simpler CI workflow would naturally emerge. But that's for @arnaudroques to decide, I don't know how wide the impact would be and I might not have time to help with it myself.

@matthew16550
Copy link
Collaborator

Hi @arnaudroques,

The Release Artifacts action did not run for v1.2021.7 or v1.2021.8 releases so it seems something is missing in the release process.

The Import version ... commits are tagged and confusingly all tags are shown in the Github "Releases" UI. But they are not an actual Github Release, I read someone describing them as "Release Placeholders". There is much discussion around this being confusing!

Creating a release I think is the step we are missing. #560 assumed we would do it manually but its my bad as I didn't make that really obvious in the discussion. Our Release Artifacts workflow action will run after this step and attach the JAR to the release.

As @ldeluigi suggests above, there are many actions available that can automate the whole release process but they are all from third parties so I'm reluctant to trust any of them without research. And then only if the action is really necessary.

What we currently do to publish the JAR is a Maven build then a POST to a single REST endpoint. I think it's getting close to the boundary of CI complexity that sensibly fits in this repo, if we want to add much more then perhaps a third-party action would be better.

release-please-action is the only obvious action from a Verified Creator, it's made by Google so at first glance seems quite trustable. However it uses Conventional Commits and does not mention Java or Maven as supported release types so might not be a good fit for PlantUML.

If you would like to automate the creation of a release in Github then a simple option we could try without third party is just to check for a relevant tag at the end of the CI workflow, something like:

if (branch == 'master' AND tag matches SOME_REGEX) {
  Build JAR
  Create Release in Github
  Upload JAR
}

I think that would simplify our workflow code because it would delete the first half of release.yml and move the rest into ci.yml. I'm happy to work on this or look at third-party actions if you would like me to?

@matthew16550
Copy link
Collaborator

Hi @arnaudroques, probably missed my above comment as the issue is currently closed. I don't have access to re-open but think we should as the JARs aren't appearing in Github.

@arnaudroques arnaudroques reopened this Aug 30, 2021
@arnaudroques
Copy link
Contributor

@matthew16550 Sorry, I indeed miss a lot here. :-)
Anyway, I've just reopened this issue and promoted you so that I will not be a bottleneck on this subject.

Thanks for your help!

I think that would simplify our workflow code because it would delete the first half of release.yml and move the rest into ci.yml. I'm happy to work on this or look at third-party actions if you would like me to?

Please go ahead. You could also open a new discussion on this subject so that other people give theirs opinions. I must say that this is far away from my area of expertise... Really sorry about that.

@matthew16550
Copy link
Collaborator

@arnaudroques I'll fix this issue first then make a Discussion. I think it will be a simpler discussion starting point once this issue is done and the two workflows are merged into one.

How do you currently make the Git tags? I will need to do the same process on my fork to test the new workflow.

@ldeluigi
Copy link

It can be done on GitHub (with the GUI) or with git tag -a "<tag-name>" -m "<tag-message>" and then git push --tags

@arnaudroques
Copy link
Contributor

How do you currently make the Git tags?

The repository is cloned on my local workstation.
So I am indeed using git tag as command line then git push.

@matthew16550
Copy link
Collaborator

@arnaudroques could you put in the exact commands with arguments here. The workflow triggering is difficult to get right so I want to be sure I'm testing exactly the right thing.

@arnaudroques
Copy link
Contributor

Sure, here we are:

git add -A .
git commit -a -m "Import version 1.2021.10"
git push --all -ff
git tag -a v1.2021.10 -m "version 1.2021.10"
git push origin v1.2021.10

Thanks !

@matthew16550
Copy link
Collaborator

Discussion started at #653.

@matthew16550
Copy link
Collaborator

I'll close this as we do have jars available in GitHub releases now.

@The-Lum
Copy link
Collaborator

The-Lum commented Oct 30, 2021

Hello @matthew16550, and all,

Have you some ideas or elements to retrieve the link to the latest PlantUML.jar on Github?
(as the 'https://sourceforge.net/projects/plantuml/files/plantuml.jar/download' for Sourceforge)

I search on:

First hint:

But I don't know what are the simple method.

Regards.

@matthew16550
Copy link
Collaborator

Hello @The-Lum

This is my attempt, it's not a one-liner but I think fairly readable.

tag=$(curl -s https://api.github.com/repos/plantuml/plantuml/releases/latest | jq -r '.tag_name')

curl "https://github.com/plantuml/plantuml/releases/download/${tag}/plantuml-${tag#v}.jar" -L -o plantuml.jar

@The-Lum
Copy link
Collaborator

The-Lum commented Sep 26, 2022

Hello all,

With #1120, and from V.1.2022.8, then here is the GH permalink (without tag or version 🎉 ) to the latest stable version:

(GH Ref.: https://docs.github.com/en/repositories/releasing-projects-on-github/linking-to-releases)

Enjoy 🎉,
Regards.

ldeluigi added a commit to ldeluigi/markdown-docs that referenced this issue Sep 26, 2022
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 a pull request may close this issue.

5 participants