Skip to content

Commit 33229fa

Browse files
authored
Merge pull request #757 from CommunityToolkit/fix/ci-tag-versioning-date-extraction
Fix CI manual tag versioning to use tag creation date
2 parents d98ebeb + a56c63f commit 33229fa

File tree

2 files changed

+5
-43
lines changed

2 files changed

+5
-43
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,11 @@ jobs:
287287
fetch-depth: 0
288288
fetch-tags: true
289289

290-
- name: Format Date/Time of Commit for Package Version
290+
- name: Format Date/Time for Package Version (Tag builds only)
291+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
291292
run: |
292-
echo "VERSION_DATE=$(git log -1 --format=%cd --date=format:%y%m%d)" >> $env:GITHUB_ENV
293+
$dateString = "${{ github.ref }}" -replace '^refs/tags/release/weekly/', ''
294+
echo "VERSION_DATE=$dateString" >> $env:GITHUB_ENV
293295
294296
- name: Restore dotnet tools
295297
run: dotnet tool restore
@@ -330,7 +332,7 @@ jobs:
330332
# Build and pack component nupkg
331333
- name: Build and pack component packages
332334
if: ${{ env.HAS_BUILDABLE_COMPONENTS == 'true' }}
333-
run: ./tooling/Build-Toolkit-Components.ps1 -MultiTargets all -Components ${{ env.CHANGED_COMPONENTS_LIST }} -WinUIMajorVersion ${{ matrix.winui }} -DateForVersion ${{ env.VERSION_DATE }} ${{ env.VERSION_PROPERTY != '' && format('-PreviewVersion "{0}"', env.VERSION_PROPERTY) || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-EnableBinlogs' || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-Verbose' || '' }} -BinlogOutput ./ -NupkgOutput ./ -Release
335+
run: ./tooling/Build-Toolkit-Components.ps1 -MultiTargets all -Components ${{ env.CHANGED_COMPONENTS_LIST }} -WinUIMajorVersion ${{ matrix.winui }} ${{ env.VERSION_DATE != '' && format('-DateForVersion {0}', env.VERSION_DATE) || '' }} ${{ env.VERSION_PROPERTY != '' && format('-PreviewVersion "{0}"', env.VERSION_PROPERTY) || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-EnableBinlogs' || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '-Verbose' || '' }} -BinlogOutput ./ -NupkgOutput ./ -Release
334336

335337
- name: Validate package names
336338
if: ${{ env.VERSION_PROPERTY != '' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}

.github/workflows/scheduled-releases.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)