Fix CI manual tag versioning to use tag creation date #757
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes issue where manually created tags produce packages with incorrect dates. Tag
release/weekly/251027(created 10/27) was producing packages dated251021(6-day mismatch).Root Cause
The CI workflow used
git log -1 --format=%cdwithout a tag reference, which extracts the commit date instead of the date from the tag name for tagged builds.Changes
Tag Builds (Fixed)
refs/tags/release/weekly/YYMMDD→YYMMDDVERSION_DATEenvironment variable for tag buildsrefs/tags/release/weekly/251027→ packages dated251027Non-Tag Builds (Main/PR - No Change)
VERSION_DATEenvironment variable is not set(Get-Date -UFormat %y%m%d)Build Script Invocation
-DateForVersionparameter now conditionally passed only whenVERSION_DATEis set${{ env.VERSION_DATE != '' && format('-DateForVersion {0}', env.VERSION_DATE) || '' }}Implementation
Rationale
Extracting from the tag name (rather than tag creation timestamp) allows for intentional back-dating or post-dating of releases, matching the pattern used in the main CommunityToolkit/Windows repository for
rel/*branches.