diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bee7174..c520c24 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,6 +18,7 @@ on: - 'src/Bbx/**' - 'tests/Bbx.Tests/**' - '.github/workflows/publish.yml' + - 'global.json' push: branches: [master] paths: @@ -49,7 +50,13 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v5 with: - global-json-file: global.json + # Both SDKs are listed, not read from global.json: under latestMajor + # setup-dotnet v5 drops the global.json version and installs + # nothing from it. global.json then rolls forward to SDK 11, which + # builds both targets, and runtime 10 runs the net10.0 tests. + dotnet-version: | + 10.0.x + 11.0.x - name: Restore run: | @@ -65,6 +72,18 @@ jobs: - name: Pack run: dotnet pack "$PROJECT_DIR" --configuration Release --no-build + - name: Check package targets + shell: bash + run: | + set -euo pipefail + # The targets depend on the SDK that built them; fail rather than + # ship a package missing one. + LISTING=$(unzip -l "$NUPKG_DIR"/solrevdev.bbx.*.nupkg) + for tfm in net10.0 net11.0; do + grep -q "tools/$tfm/any/bbx.dll" <<<"$LISTING" \ + || { echo "Package is missing tools/$tfm" >&2; exit 1; } + done + publish: if: github.event_name != 'pull_request' environment: production @@ -81,7 +100,13 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v5 with: - global-json-file: global.json + # Both SDKs are listed, not read from global.json: under latestMajor + # setup-dotnet v5 drops the global.json version and installs + # nothing from it. global.json then rolls forward to SDK 11, which + # builds both targets, and runtime 10 runs the net10.0 tests. + dotnet-version: | + 10.0.x + 11.0.x - name: Determine and bump version id: bump @@ -177,6 +202,18 @@ jobs: - name: Pack run: dotnet pack "$PROJECT_DIR" --configuration Release --no-build + - name: Check package targets + shell: bash + run: | + set -euo pipefail + # The targets depend on the SDK that built them; fail rather than + # ship a package missing one. + LISTING=$(unzip -l "$NUPKG_DIR"/solrevdev.bbx.*.nupkg) + for tfm in net10.0 net11.0; do + grep -q "tools/$tfm/any/bbx.dll" <<<"$LISTING" \ + || { echo "Package is missing tools/$tfm" >&2; exit 1; } + done + - name: Verify package id: package shell: bash diff --git a/AGENTS.md b/AGENTS.md index 7fa571a..71c39df 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,12 +16,22 @@ Bitbucket. Output is JSON so scripts and agents can consume it. ## Commands ```bash -dotnet build src/Bbx/Bbx.csproj # net10.0; SDK pinned by global.json -dotnet test tests/Bbx.Tests/Bbx.Tests.csproj # xunit v3, no network -dotnet run --project src/Bbx/Bbx.csproj -f net10.0 -- +dotnet build src/Bbx/Bbx.csproj # net10.0, plus net11.0 when SDK 11+ is present +dotnet test tests/Bbx.Tests/Bbx.Tests.csproj # xunit v3, no network; every built target +dotnet test tests/Bbx.Tests/Bbx.Tests.csproj -f net10.0 # one target only +dotnet run --project src/Bbx/Bbx.csproj -f net11.0 -- dotnet pack src/Bbx/Bbx.csproj -c Release ``` +.NET 10 is the LTS baseline. `global.json` asks for SDK `10.0.100` with +`rollForward: latestMajor` and no prereleases, so the newest installed SDK +builds. The target list depends on that SDK: 11 or later builds `net10.0` and +`net11.0`, SDK 10 alone builds `net10.0` only. The published package must carry +both, so CI installs SDKs 10.0.x and 11.0.x explicitly and checks the package +for both `tools/` folders. Do not switch the workflow back to +`global-json-file`: setup-dotnet installs nothing from a `latestMajor` +global.json. + Tests must pass before you commit. They use a fake HTTP handler and never touch the network. Do not add a test that needs credentials. New behaviour ships with a test. diff --git a/CHANGELOG.md b/CHANGELOG.md index 74da4ea..095393d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,19 @@ so commit history is the source of truth for the fine grain. Versioning follows [Semantic Versioning](https://semver.org/): `MAJOR.MINOR.PATCH`. +## [1.5.0] + +### Changed + +- The package now targets both `net10.0` and `net11.0`. `RollForward` stays + `Major`, so a machine with only a newer runtime still runs it. bbx already ran + on .NET 11 through roll-forward, so this is for consistency, not a fix. +- .NET 10 is the LTS baseline for building. `global.json` asks for SDK + `10.0.100` with `rollForward: latestMajor` and `allowPrerelease: false`, so + the newest installed release SDK builds. SDK 11 or later builds both targets; + SDK 10 alone builds `net10.0` only. CI installs SDKs 10.0.x and 11.0.x and + fails if the package is missing either target. + ## [1.4.3] ### Fixed diff --git a/README.md b/README.md index 9b4e8c9..b140bf7 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

NuGet NuGet downloads - .NET 10 + .NET 10 and 11 MIT

@@ -50,7 +50,7 @@ dotnet tool update -g solrevdev.bbx dotnet tool uninstall -g solrevdev.bbx ``` -Requires the [.NET 10 runtime or SDK](https://dotnet.microsoft.com/download). If `bbx` isn't found afterwards, add the tools directory to your `PATH`: +Requires the [.NET 10 or .NET 11 runtime or SDK](https://dotnet.microsoft.com/download). The package carries a build for each. If `bbx` isn't found afterwards, add the tools directory to your `PATH`: ```bash export PATH="$PATH:$HOME/.dotnet/tools" @@ -560,11 +560,14 @@ bbx --help ```bash git clone && cd solrevdev.bbx +# SDK 10 or later. global.json starts at 10.0.100 and rolls forward to the +# newest installed SDK. SDK 11 builds net10.0 and net11.0; SDK 10 alone builds +# net10.0 only. Testing net10.0 under SDK 11 needs the .NET 10 runtime too. dotnet build src/Bbx/Bbx.csproj dotnet test tests/Bbx.Tests/Bbx.Tests.csproj -# run without installing -dotnet run --project src/Bbx/Bbx.csproj -f net10.0 -- repo list -w myws +# run without installing; pick a target with -f +dotnet run --project src/Bbx/Bbx.csproj -f net11.0 -- repo list -w myws # install your build globally dotnet pack src/Bbx/Bbx.csproj -c Release diff --git a/global.json b/global.json index cb6c0cd..6a28850 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,7 @@ { "sdk": { - "version": "10.0.302", - "rollForward": "latestMinor" + "version": "10.0.100", + "rollForward": "latestMajor", + "allowPrerelease": false } } diff --git a/scripts/smoke.sh b/scripts/smoke.sh index 8d196e5..f8a6056 100755 --- a/scripts/smoke.sh +++ b/scripts/smoke.sh @@ -4,7 +4,7 @@ # # Requirements: # - `bbx` on PATH (either `dotnet tool install -g solrevdev.bbx` or -# `dotnet run --project src/Bbx/Bbx.csproj -f net10.0 --` aliased). +# `dotnet run --project src/Bbx/Bbx.csproj -f net11.0 --` aliased). # - Stored API-token credentials (`bbx auth status` must succeed). This # script will not prompt; run `bbx auth login` first. # - `jq` for quick output sanity checks. diff --git a/src/Bbx/Bbx.csproj b/src/Bbx/Bbx.csproj index 9826583..27d1d3a 100644 --- a/src/Bbx/Bbx.csproj +++ b/src/Bbx/Bbx.csproj @@ -6,7 +6,9 @@ is named for the command it provides. --> bbx Bbx - net10.0 + + net10.0 + net10.0;net11.0 latest enable enable @@ -22,7 +24,7 @@ - 1.4.4 + 1.5.0 solrevdev diff --git a/tests/Bbx.Tests/Bbx.Tests.csproj b/tests/Bbx.Tests/Bbx.Tests.csproj index 51e4987..650e64a 100644 --- a/tests/Bbx.Tests/Bbx.Tests.csproj +++ b/tests/Bbx.Tests/Bbx.Tests.csproj @@ -1,7 +1,9 @@ - net10.0 + + net10.0 + net10.0;net11.0 latest enable enable