actions-set-product-version
is a Github action that acts as a bridge between the product repo and our new CRT feature: automated version bumping. This action should be used in the build.yml
to parse the version/VERSION
file that lives in all product repos.
THe following describes what this action does:
- Allows for the static version string from the
version/VERSION
file to be read by the new CRT workflow and automagically be bumped to the next version (whether it be a minor, or patch, or major version bump). - Outputs an error if there’s no
VERSION
file in theversion/ dir
- Outputs an error if there’s no version string in the VERSION file
- Is able to parse
product_version
if it is1.3.0-alpha1
as1.3.0
(example: whenproduct_version = 1.3.0-alpha1
,base_version = 1.3.0
) - Is able to parse prerelease product versions such as
alpha1
(exampleprerelease_product_version = alpha1
) in the statement above.
Note that the version/VERSION
version should never contain metadata - only release version and prerelease information.
This action has three outputs from parsing the release/prerelease information:
- product-version (full product version string: eg.
1.0.0-dev
) - base-product-version (product version stripped of prerelease information: eg.
1.0.0
) - prerelease-product-version (prerelease information
dev
)
This action should be implemented in product repo build.yml
files. The action is intended to grab the version from the version file at the beginning of the build, then passes those versions (along with metadata, where necessary) to any workflow jobs that need version information.