Nightly #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Nightly | |
| # After CI succeeds on master, publish a dated prerelease with the packed | |
| # packages, then prune old nightlies on a GFS schedule. Does NOT push to NuGet. | |
| on: | |
| workflow_run: | |
| workflows: [CI] | |
| branches: [main] | |
| types: [completed] | |
| workflow_dispatch: {} | |
| # Force JavaScript-based actions to run on Node 24 instead of the deprecated Node 20 ahead of | |
| # the 2026-06-16 hard cutover, until we bump each action to a Node-24-native major version. | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' | |
| jobs: | |
| nightly: | |
| if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.x | |
| - name: Compute nightly tag | |
| run: echo "NIGHTLY_TAG=nightly-$(date -u +%Y%m%d)" >> "$GITHUB_ENV" | |
| - name: Stamp versions | |
| run: perl ".github/workflows/scripts/version.pl" --stamp | |
| - name: Pack packages | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mkdir -p artifacts | |
| for p in \ | |
| Backports/Backports.csproj \ | |
| Corlib.Extensions/Corlib.Extensions.csproj \ | |
| PresentationCore.Extensions/PresentationCore.Extensions.csproj \ | |
| System.Drawing.Extensions/System.Drawing.Extensions.csproj \ | |
| System.Windows.Forms.Extensions/System.Windows.Forms.Extensions.csproj \ | |
| System.DirectoryServices.AccountManagement.Extensions/DirectoryServices.Extensions.csproj; do | |
| dotnet pack "$p" --configuration Release --output ./artifacts | |
| done | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| # --notes-only: CHANGELOG.md is committed by release.yml exclusively. | |
| - name: Generate release notes (functional changes, bucketed by + - * # !) | |
| run: node ".github/workflows/scripts/update-changelog.mjs" --nightly --notes-only --notes RELEASE_NOTES.md | |
| # Same-day re-run: drop the existing nightly release AND its tag first, | |
| # so the tag always points at the SHA that was actually built. | |
| - name: Replace same-day nightly (release + tag), if any | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh release delete "${{ env.NIGHTLY_TAG }}" --cleanup-tag --yes || true | |
| - name: Publish nightly prerelease | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.NIGHTLY_TAG }} | |
| name: ${{ env.NIGHTLY_TAG }} | |
| target_commitish: ${{ github.event.workflow_run.head_sha || github.sha }} | |
| prerelease: true | |
| files: artifacts/*.nupkg | |
| body_path: RELEASE_NOTES.md # commit-message changelog, not GitHub's PR notes | |
| - name: Prune old nightlies (GFS) | |
| run: node ".github/workflows/scripts/prune-nightlies.mjs" | |
| env: | |
| GH_TOKEN: ${{ github.token }} |