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

Release engineering improvements #1844

Merged

Conversation

andyshinn
Copy link
Contributor

@andyshinn andyshinn commented Mar 30, 2021

Some release engineering improvements.

  • Moved version to be set in pre-script which grabs version from package.json. One less place to modify version number. Open to suggestions on better managing the version.
  • Scripts didn't seem to necessarily run in order of listing and caused race conditions in gzip firmware and renaming. Since both scripts were relying on build_output folder structure they have been combined and more generalized.
  • Release firmwares have a new build option for the build name which gets used by the new output_bins.py script to generate release binaries in build_output/release if the env variable WLED_RELEASE is set to something (such as WLED_RELEASE=1).
  • Add requirements.in and requirements.txt to help version the PlatformIO environment. The requirements.in file is used by pip-tools to update requirements.txt.
  • Runs CI action in a matrix using default environments to build more in parallel.
  • CI action has a release job that will run on tag push or release creation and push the release named binaries (ones using WLED_RELEASE_NAME) to the release. When commiting and then pushing first using git push --tags the release gets created as a draft which uploads the assets but gives opportunity to edit before publishing. You can also publish a release tag in the interface and it will run and upload the binaries to that existing release based on same tag.

We also have VERSION (the dated version build code) and WLED_COENAME in C++ headers. Thoughts about removing these and making them available in platformio.ini instead so they are more readily available to the build process and pipeline?

@andyshinn andyshinn force-pushed the feature/release-engineering-improvements branch 30 times, most recently from bb0f89c to a679697 Compare March 31, 2021 00:30
@andyshinn andyshinn force-pushed the feature/release-engineering-improvements branch 6 times, most recently from 636e52f to 04ae0e4 Compare March 31, 2021 00:54
@andyshinn andyshinn marked this pull request as ready for review March 31, 2021 01:16
@andyshinn andyshinn force-pushed the feature/release-engineering-improvements branch from 04ae0e4 to 4c5dcde Compare March 31, 2021 01:17
@jaredgisin
Copy link
Contributor

Nice! Will be nice to have the build output scripts working more reliably.

@andyshinn andyshinn force-pushed the feature/release-engineering-improvements branch 2 times, most recently from 0d24f1f to 844923a Compare April 6, 2021 02:54
@andyshinn andyshinn force-pushed the feature/release-engineering-improvements branch from 844923a to 3b1abb0 Compare April 6, 2021 02:56
@Aircoookie
Copy link
Member

This is a whole slew of great improvements!
Will review, test and hopefully merge tomorrow.

The codename is changed infrequently and could use the same logic as WLED_VERSION - that is being defined in package.json and auto-populated. It's fine in wled.h though as it does not need to be used in multiple locations. The same is true for VERSION, although that is/should be bumped with every push. One potential minor problem I see is compiling with Arduino IDE (I don't know who would prefer that over PIO, but technically it's a possibility), which would need to fallback to meaningless defaults for all version identifiers.

Once again, awesome work 👍

@Aircoookie Aircoookie merged commit 0f82730 into wled:master Apr 21, 2021
@Aircoookie
Copy link
Member

Works very well overall!
The only part I haven't figured out yet is how to conveniently set and unset the WLED_RELEASE environment variable. Would it be more convienient to set it with a cpp define or a var in package.json or am I missing an easy way to set WLED_RELEASE?

@andyshinn andyshinn deleted the feature/release-engineering-improvements branch April 21, 2021 23:46
@andyshinn
Copy link
Contributor Author

The idea was that it is always set for the 4 common envs we release now (via https://github.com/Aircoookie/WLED/blob/master/.github/workflows/wled-ci.yml#L55-L57) but you can set it via shell if you want a release binary name for one-offs with something like:

WLED_RELEASE=1 pio run -e d1_mini

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 this pull request may close these issues.

4 participants