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 the latest phar file to the GitHub Pages to have a consistent URL #682
Add the latest phar file to the GitHub Pages to have a consistent URL #682
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version can be calculated automatically
- 1 style-fix
But I fully approve.
I changed it to use the GitHub API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this would "disallow" us to release minor/patch after a more advanced major/minor.
Then it only allow to download the latest version.
So I propose instead to:
- loop on all releases of
https://api.github.com/repos/phpmd/phpmd/releases
(actually there are just 2.6.1 and 2.7.0 now as other tags did not use the GitHub release system and I think it's OK not to keep those releases) then save those releases (if they do not yet exist) at/static/2.7.0/phpmd.phar
URL, then keeping all the->tag_name
in an array, you canusort
them to get the latest: https://3v4l.org/Gpj2j - copy the latest if different from the previous latest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, for me it's now perfect regarding the script but I realize it's in conflict with #624 that remove bin/build-website.
I will do a branch with both merged to see how to combine.
Good that you found that, I didn't think about it. Can you verify the working locally? Maybe I test to much but I now get a 403 on https://api.github.com/repos/phpmd/phpmd/releases |
Type: feature / documentation update
Issue: #619
Breaking change: no
This PR adds the phpmd.phar to the GitHub pages and update the url in the documentation to
I use a variable with the version (line 238) that need to be updated with every new version. Another approach is to read the latest version from the api: https://api.github.com/repos/phpmd/phpmd/releases/latest But then there is a change that we have a version that is the latest but not really the latest that conflicts. (Like if we have a 2.7.0 but after that release a 2.6.2)If wanted I can refactor this to use the api for the latest version.
After feedback I changed it to use the GitHub Api