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

build workflow should produce a unique version number based on timestamp or commit #16

Open
JonnyOThan opened this issue Aug 5, 2024 · 3 comments
Labels
enhancement New feature or request github-actions Relates to github actions and workflows

Comments

@JonnyOThan
Copy link
Contributor

JonnyOThan commented Aug 5, 2024

Right now, when using build.yml as a CI action all of the artifacts end up with the same version number (whatever is committed in the repo). We should set the 4th segment of the version (usually named "build", conveniently) to something unique (timestamp, commit, etc) so that people consuming the artifacts can accurately report what version they were using.

@JonnyOThan JonnyOThan added enhancement New feature or request github-actions Relates to github actions and workflows labels Aug 5, 2024
@drewcassidy
Copy link
Member

https://github.com/drewcassidy/KSP-Conformal-Decals/blob/main/Scripts/version.py#L15-L23 my solution was to use the commit hash, then a large number for releases

@Twinki14
Copy link
Contributor

Twinki14 commented Aug 31, 2024

I'd suggest two totally seperate versions,

  • Production, semantic based (1.0.0)
  • Development, semantic based with a short commit hash suffix (1.0.1-dev-2135acc or 1.0.1-dev / 1.0.1-beta when produced from a GitHub release)

Production built from a GitHub release that isn't marked as pre-release

Development built any time a GitHub release is made marked as pre-release, or on any push to the default branch

@drewcassidy
Copy link
Member

drewcassidy commented Sep 5, 2024

MinVer has a nice solution for this using the git commit distance and hash

results in an InformationalVersion like so:
0.3.1-alpha.0.44+72e85fe6aa59466bb50da1f43d49e38a40ac0c6d
meaning a commit after the 0.3.0 tag by 44 commits. This value gets printed to the KSP log under "Mod DLLs found:"

Supporting this requires no changes in KSPBuildTools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request github-actions Relates to github actions and workflows
Development

No branches or pull requests

3 participants