diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00364b5a0..1686fa8ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -287,9 +287,11 @@ jobs: fetch-depth: 0 fetch-tags: true - - name: Format Date/Time of Commit for Package Version + - name: Format Date/Time for Package Version (Tag builds only) + if: ${{ startsWith(github.ref, 'refs/tags/') }} run: | - echo "VERSION_DATE=$(git log -1 --format=%cd --date=format:%y%m%d)" >> $env:GITHUB_ENV + $dateString = "${{ github.ref }}" -replace '^refs/tags/release/weekly/', '' + echo "VERSION_DATE=$dateString" >> $env:GITHUB_ENV - name: Restore dotnet tools run: dotnet tool restore @@ -330,7 +332,7 @@ jobs: # Build and pack component nupkg - name: Build and pack component packages if: ${{ env.HAS_BUILDABLE_COMPONENTS == 'true' }} - 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 + 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 - name: Validate package names if: ${{ env.VERSION_PROPERTY != '' && env.HAS_BUILDABLE_COMPONENTS == 'true' }} diff --git a/.github/workflows/scheduled-releases.yml b/.github/workflows/scheduled-releases.yml deleted file mode 100644 index 067b95f87..000000000 --- a/.github/workflows/scheduled-releases.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: scheduled-releases - -on: - schedule: - # Runs every Wednesday at 08:00 UTC (midnight PST / 1:00 AM PDT) - - cron: '0 8 * * 3' - - # Allows manual triggering for convenience - workflow_dispatch: - -jobs: - tag-weekly-release: - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history for tags - - - name: Create release - id: create-release - run: | - # Date in the format YYMMDD - TAG="release/weekly/$(date +%y%m%d)" - - # Get previous weekly tag for sparse release notes - PREV_TAG=$(git tag --list 'release/weekly/*' --sort=-creatordate | head -n 1) - - # gh release create will automatically create the tag if it doesn't exist - # This triggers the build workflow's tag listener, unlike git tag + git push - # which doesn't trigger workflows when done by Actions tokens - gh release create "$TAG" \ - --title "Weekly Release $(date +%y%m%d)" \ - --generate-notes \ - --notes-start-tag "$PREV_TAG" \ - --fail-on-no-commits \ - --prerelease