-
Notifications
You must be signed in to change notification settings - Fork 398
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 Workflow Action to build and upload webapp bundle on Release #2161
Add Workflow Action to build and upload webapp bundle on Release #2161
Conversation
Pull Request Test Coverage Report for Build 7235131391Warning: This coverage report may be inaccurate.We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
💛 - Coveralls |
Looks good so far!
Why wouldn't it be available if this workflow is automatically triggered? Are you referring to a time where the release is out but the action failed and didn't produce an webapp artifact? |
Come to think about it again, im not quite sure anymore xD |
Here are some of the thoughts i had (feedback appreciated): I had the idea (and it would actually be the right thing to do from a versioning aspect) that after a release, the version on develop will be raised (so currently on develop would be v3.5.0-alpha). Thinking further on this there could be a Prerelease (as draft releases are not supported) for the latest develop version (-alpha.x) to also supply a webapp bundle, so no inital build is needed. I think i was still somewhere in this scenarios, when i added the part mentioned above. |
I like the idea, but I am not sure how this could be properly handled. We would have to tag every commit to f3/develop with the recent version tag? Else, how would github now where to to which release it should upload the artifects to? It's typically solved through nightly builds rather than an actual version. But I am not sure if that's supported. (https://dev.to/derlin/how-to-create-nightly-releases-with-github-actions-fpp or https://github.com/knightlyjs/knightly) |
Yes, thats the tricky part and im also unsure how this can be done best. Also all steps have to be done automatically, otherwise its just not feasible. I also see the options you described.
Ideas to deal with the negatives of 2, which i think are pretty serious and could cause more unnecessary bugreports.
If we want to add the this "develop version" feature, personally i would suggest to go with case 2.a. |
While I agree with all your points, you are taking a sledgehammer to crack a nut. Let's not overthink this. And if someone still wants to use develop, there is a high chance they use the latest commit (and also get the latest knighly build, see last paragraph). -> 99.9% covered.
I consider this an extreme edge case and therefore don't think this is very serious nor will it cause many bug reports. And yes, for people that want to build their own branch, building the webapp locally remains the first choice. It should be the default use case. The download is just there because some Pi's just don't have the memory to compile a NodeJS app (up to Pi 3b+, Zero2 etc) Last but not least, for the main repo, we could always trigger a webapp build after a commit which is saved with Updating version.py regularly does not scale. Updating tags to the next commit doesn't scale either. I also don't recognize this behaviour from other projects, tbh. |
Absolutly agree to this. It was just an option in the line of thoughts, but nothing you would really want to do.
You are right. That should be the part we should care about most and what point 2.a. is also about. So i think we are pretty close to a process definition. Automation:
Installation:
Should this process also be applied to the |
Process looks good to me 👍
Do I understand this correctly: After a merge to main, we must update
I believe yes. But here, I would like the build to not have the commit hash as part of the name :-) |
Ok, always questionable to do the same thing but different, but should be possible without to much hassle ^^
I would suggest, changing the version BFEORE the merge (the last commit). Just like its done at the moment. But that bring up another point. if the version is changed on develop, this must not trigger the creation of a new release, as it would tag the wrong commit. This has to be implemented in the action (ignore the run if on develop branch, an version has no identifier). This would mean between the version changes before and after the merge to main, this action wont run on the develop branch. But i think that should be fine. |
I am not too bound to this. Let's keep it simple, even if it means have have commit hashs in the name. The rest all makes sense. One last question though. Will every commit trigger a new build even though the webapp code has not changed? I guess it would, right? |
👍 We can see how it works out, and if we want to adjust that later on.
I would say yes, as it makes the process less complex. Every commit has its own bundle, so we can just use the current commit hash. The bundle has currently a size of 1.3 MB so gathering every commit bundle in the release shouldn't be a problem to soon, even with a few hundred commits. |
remove old workflow
add download for latest bundle: used if no bundle for the commit is found and force download is set.
changed order: kiosk_mode and node option change message to better reflect the behavior. move local build finmessage to the 'yes' case: Download is forced and node is not installed. the message is irritating
Implemented ProcessAutomation
* version string are validated against Semantic Versioning format Installation
Demo
|
1a190eb
to
0cbf61e
Compare
The CI with the webapp download fails as there is currently no prerelease for develop with a |
Does it make sense to use the short hashes in the file name of the web app package? feels easier to handle :) |
I am late to the party now.
|
I didn't use the short version as it wasn't easier to begin with :)
Although common some problems with duplication are reported. If we really shorten the length, i would go for some more characters like 12 -15, or so. Its still a lot less, but should more ensure uniqueness. |
I believe 7 chars is the typical length, it's what I read |
Thas what a read regarding the default length and its uniquness.
Maybe just go for 10 so no one has to touch this very soon? ^^ |
9e65de4
into
MiczFlor:future3/develop
…zFlor#2161) * fix editorconfig for yml files * add workflow for webapp build on release * filter paths for CI installation worlflow * abort installation if needed download failed * fix SemVer definition * add workflow for webapp bundle build and releases. remove old workflow * add main to version.py * fix prebuild webapp bundle download add download for latest bundle: used if no bundle for the commit is found and force download is set. * changes to webapp build option changed order: kiosk_mode and node option change message to better reflect the behavior. move local build finmessage to the 'yes' case: Download is forced and node is not installed. the message is irritating * add checks for correct version for branch * activate official repo check * set next develop version * Update message * make webapp downloads on forks possible * bugfix elif * add abort if sources failed to load * Updated WEBAPP NODE message * change filename to short hash (10 chars) * add semver ref to version.py
Added a workflow action that builds and uploads the WebApp tar.gz bundle.
This workflow is triggered on publishing a release and the bundle will be added as an asset to this release.The version is based on the given releases tag (webapp-<tag_name>.tar.gz).
Every release on any Branch is supported. Changed the format of the version extra to build a SemanticVersion compatible string.
Draft releases are NOT supported and will not trigger this (github trigger restriction).
Demo Release: https://github.com/AlvinSchiller/RPi-Jukebox-RFID/releases/tag/v3.1000.10000-alpha.2Demo Run: https://github.com/AlvinSchiller/RPi-Jukebox-RFID/actions/runs/7196517075Changes to come:- [ ] Add fallback for WebApp installation option if current version bundle is not availableImportant notes:For the next release the version.py must be changed on the develop branch before the merge. Therefor after this is done CI Tests will fail (and after the merge also an installation of the main branch) cause the needed webapp bundle is not yet available without a published release.So changing version.py should be done right before the merge. Also merging to main and publishing a release should be done right after another, to avoid such "errors".Updated process: see #2161 (comment)