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

Generate commit bins and release bins #48

Open
ewowi opened this issue Apr 16, 2024 · 14 comments
Open

Generate commit bins and release bins #48

ewowi opened this issue Apr 16, 2024 · 14 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ewowi
Copy link
Owner

ewowi commented Apr 16, 2024

Generate commit bins and release bins is currently not working as it should.

In StarMod .github/workflows/pio.yml generates this

Current situation:

  • commit bins: StarMod-esp32-${{env.git_branch}}-${{env.git_hash}}.bin generated from .pio/build/esp32dev/firmware.bin
  • release bins: nothing generated

Desired situation: for both commit bins and release bins, a bin should be generated for each env in pio.ini following the same syntax as local vscode/pio build file names:

  • {$APP}{$VERSION}{$PIOENV}.bin e.g. StarMod_24041415_esp32dev.bin, variables are defined in pio.ini
  • see tools/post_build: builds local files in ~/Downloads and GitHub builds in GitHub/ewowi/StarMod/build_output/release

To be done:

  • Get inspired by Github/MoonModules/WLED/.github/workflows/wlec-ci.yml (copy-refactor-paste / MVP (Minimum Viable Product))
    • don't use build_output/firmware and build_output/map (unless good reason)
    • don't use .bin.gz (unless good reason)
    • take all the envs per default, no need to implement default_envs (unless good reason)
    • use the code to take bin files from build_output/release and upload artifacts and release
  • add this to pio.yml
  • make changes to post_build.py if needed
@ewowi ewowi added enhancement New feature or request help wanted Extra attention is needed labels Apr 16, 2024
@ewowi
Copy link
Owner Author

ewowi commented Apr 16, 2024

In current situation normal commits run fine.

Creating a release results in error:

image

See also pio.yml: Upload Artifact:

image

For some reason it expects something else if release is created

Might be that if this error is solved, release bins are also generated

@ewowi
Copy link
Owner Author

ewowi commented Apr 16, 2024

Created the first baseline releases for StarMod and StarLeds - bins have been added manually - workflows have failed due to above error

https://github.com/MoonModules/StarModLeds/releases/tag/v0.0.0

https://github.com/ewowi/StarMod/releases/tag/v0.0.0

@netmindz
Copy link
Collaborator

#49

@netmindz
Copy link
Collaborator

@netmindz
Copy link
Collaborator

Can now create builds with the right assets for release and regular builds now using the build cache and with matrix so just over a minute rather then just under 7 mins

@ewowi
Copy link
Owner Author

ewowi commented Apr 23, 2024

Is it possible to have the file names like this?:
{$APP}{$VERSION}{$PIOENV}.bin e.g. StarMod_24041415_esp32dev.bin, variables are defined in pio.ini

Both in actions/artifacts and in releases:

image

->

image

So it is consistent with the file names generated by post_build.py

And for user friendlyness, is it possible to list every file in actions.artifacts instead of a zip file, so user can see immediately which files are available

@netmindz
Copy link
Collaborator

So the naming is {$APP}-{$PIOENV}-{$VERSION}-{$GITSHA}.bin

I think having the env name first makes it easier to see you are using the write image for the right hardware, then the next most important thing is the version. If the version is the branch name then you also need the gitsha so you can be sure you are testing what you think you are. When using a release tag, then the gitsha is redundant, but as it's at the end then not really too much of an issue

I don't follow your comment about the zip file, the assets are not zips, but the image ready to use now

@ewowi
Copy link
Owner Author

ewowi commented Apr 23, 2024

In the release assets you see individual bins but in actions / artifacts I see only one file, which, if downloaded is a zip file containing all bins:

IMG_6725

@ewowi
Copy link
Owner Author

ewowi commented Apr 23, 2024

WLED shows them individually:

Uploading IMG_6726.png…

@ewowi ewowi reopened this Apr 26, 2024
@netmindz
Copy link
Collaborator

Fixed here #53

@ewowi
Copy link
Owner Author

ewowi commented Apr 27, 2024

One step closer ;-)!

image

Only names should be same as names generated by VSCode/PIO:

image

APP, PIOENV and VERSION is used for this and is defined in platformio.ini

@netmindz
Copy link
Collaborator

What is actually creating that build number? Is it just date and time?

@netmindz
Copy link
Collaborator

Generally for CI builds the assets should be given a naming that matches the source code version so you can trace that back to the right source code

@ewowi
Copy link
Owner Author

ewowi commented Jul 20, 2024

Bins are also not generated in a release, was also something similar mentioned for WLED MM recently? @netmindz any ideas what we can do to have bins with the right naming generated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants