Skip to content

chore: release 0.21.0 #39

chore: release 0.21.0

chore: release 0.21.0 #39

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
# A dated release header in CHANGELOG.md is a claim that the version is published.
# CHANGELOG.md ships inside every package and PackageReleaseNotes points at it, so a
# dated header for a version that was never tagged becomes a false statement on
# nuget.org. Nothing but discipline enforced the ordering, and discipline slipped once:
# a version bump rode inside a feature commit, and an unpublished version reached a
# consumer through a local package feed with nothing in the tree contradicting it.
#
# Consequence for releasing: main and the tag must land together --
# git push --atomic origin main vX.Y.Z
# Pushing main alone leaves this red until the tag arrives. That is the point.
changelog-tag:
name: Dated release header has its tag
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v5
- name: A dated release header must have a matching tag
run: |
VERSION=$(grep -m1 -oP '^## \[\K[0-9]+\.[0-9]+\.[0-9]+(?=\] - )' CHANGELOG.md || true)
if [ -z "$VERSION" ]; then
echo "::error::No dated release header (## [X.Y.Z] - DATE) found in CHANGELOG.md."
exit 1
fi
echo "Newest dated release header: $VERSION"
if [ -z "$(git ls-remote --tags origin "refs/tags/v$VERSION")" ]; then
echo "::error::CHANGELOG.md declares $VERSION released, but tag v$VERSION does not exist. A dated release header may only reach the default branch together with its tag -- push them atomically (git push --atomic origin main v$VERSION), or keep the entry under [Unreleased] until you release."
exit 1
fi
echo "Tag v$VERSION exists."
# The release job blocks a wrong "Packages affected" list from being published, which is the
# contract. But it fires at the moment of release, when the correction costs a follow-up
# release. This runs the same check against [Unreleased] on every push and pull request, so
# a package touched without being listed shows up while the entry is still being written.
# It warns rather than fails: an entry legitimately lags its commit inside a single branch,
# and a check that goes red for that would be switched off rather than obeyed.
packages-affected:
name: Packages affected covers [Unreleased] (advisory)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Compare [Unreleased] against the diff since the last release
run: .github/scripts/packages-affected.sh unreleased
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Cache NuGet packages
uses: actions/cache@v5
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Build.props') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore IyuFramework.slnx
- name: Build
run: dotnet build IyuFramework.slnx -c Release --no-restore
- name: Test
run: dotnet test IyuFramework.slnx -c Release --no-build --verbosity normal