Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- 'src/Bbx/**'
- 'tests/Bbx.Tests/**'
- '.github/workflows/publish.yml'
- 'global.json'
push:
branches: [master]
paths:
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 13 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -- <args>
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 -- <args>
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.
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p>
<a href="https://www.nuget.org/packages/solrevdev.bbx"><img src="https://img.shields.io/nuget/v/solrevdev.bbx.svg?logo=nuget" alt="NuGet"></a>
<a href="https://www.nuget.org/packages/solrevdev.bbx"><img src="https://img.shields.io/nuget/dt/solrevdev.bbx.svg" alt="NuGet downloads"></a>
<img src="https://img.shields.io/badge/.NET-10-512BD4?logo=dotnet&logoColor=white" alt=".NET 10">
<img src="https://img.shields.io/badge/.NET-10%20%7C%2011-512BD4?logo=dotnet&logoColor=white" alt=".NET 10 and 11">
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT">
</p>
</div>
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -560,11 +560,14 @@ bbx <group> <command> --help
```bash
git clone <this repo> && 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
Expand Down
5 changes: 3 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"sdk": {
"version": "10.0.302",
"rollForward": "latestMinor"
"version": "10.0.100",
"rollForward": "latestMajor",
"allowPrerelease": false
}
}
2 changes: 1 addition & 1 deletion scripts/smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions src/Bbx/Bbx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
is named for the command it provides. -->
<AssemblyName>bbx</AssemblyName>
<RootNamespace>Bbx</RootNamespace>
<TargetFramework>net10.0</TargetFramework>
<!-- The published package needs both targets and CI installs both SDKs so it ships both; SDK 10 alone builds net10.0 only. -->
<TargetFrameworks>net10.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '11.0'))">net10.0;net11.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -22,7 +24,7 @@

<!-- First public release. CI bumps this; a plain push to master bumps the
patch, larger bumps go through workflow_dispatch. -->
<Version>1.4.4</Version>
<Version>1.5.0</Version>

<!-- NuGet metadata -->
<Authors>solrevdev</Authors>
Expand Down
4 changes: 3 additions & 1 deletion tests/Bbx.Tests/Bbx.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<!-- The published package needs both targets and CI installs both SDKs so it ships both; SDK 10 alone builds net10.0 only. -->
<TargetFrameworks>net10.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '11.0'))">net10.0;net11.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
Loading