Skip to content

Commit 5f39c7e

Browse files
build: Fallout CI, trusted-publishing, spec tests + Scrutor 7.x bump (#2)
* build: Fallout CI, trusted-publishing & spec tests Modernizes the repo's build/release/test infrastructure to match the TVDB sibling repo (Fallout-generated CI, OIDC trusted publishing, spec tests). Library code and dependency pins are untouched — Scrutor-major/TFM bumps are tracked separately as modernization. CI (Fallout, C#): - build/ Fallout project (Build.cs) with Test + Pack targets; .github/workflows/ build.yml is GENERATED from the [GitHubActions] attribute (never hand-edited). - Polyglot build.cmd/build.sh/build.ps1 bootstrappers; .fallout root marker; .config/dotnet-tools.json (Fallout.GlobalTool + GitVersion, both 10.3.49/6.3.0). - GitVersion.yml, tag-driven: MAJOR tracks compatible Scrutor major, MINOR.PATCH is our internal counter. Removed the old publish-nuget.yml (brandedoutcast). Publishing (hand-written publish.yml, documented exception): - Tag-driven: nuget.org via Trusted Publishing (OIDC, no stored key) + GitHub Packages + a GitHub Release with the .nupkg attached and label-categorized notes (.github/release.yml). Tests (spec-style, no CPM): - tests/Scrutor.Extensions.HttpClient.Specs: 7 xUnit/FluentAssertions specs proving .AsHttpClient()/.AsHttpClient(name) register scanned classes as typed clients (factory wired, named-client config + handler pipeline flow through, transient lifetime, unnamed overload) + a PublicApiGenerator+Verify public-surface baseline. CLAUDE.md documents all of the above. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat: bump to Scrutor 7.x — package major aligns (7.x ↔ Scrutor 7.x) The `.AsHttpClient()` bridge sits entirely on Scrutor's stable RegistrationStrategy seam, so the 5→7 bump is clean: dependency change only, zero code changes, all 7 specs (incl. the PublicApiGenerator baseline) pass unchanged against Scrutor 7.0.0. - Scrutor `[5.1.2,6.0.0)` → `[7.0.0,8.0.0)`; Microsoft.Extensions.Http upper bound → `<11.0.0` (Scrutor 7 pulls DI abstractions 10.x). - Version convention now 7.x per GitVersion.yml (MAJOR = compatible Scrutor major; 6.x was skipped/never adopted). Fallback version + docs updated. Deferred modernization (discuss first): multi-target TFMs; source-generator rewrite to drop the MakeGenericMethod reflection (the only non-trim/AOT-friendly bit). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b9a8ff0 commit 5f39c7e

25 files changed

Lines changed: 840 additions & 77 deletions

‎.config/dotnet-tools.json‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"GitVersion.Tool": {
6+
"version": "6.3.0",
7+
"commands": [
8+
"dotnet-gitversion"
9+
],
10+
"rollForward": true
11+
},
12+
"fallout.globaltool": {
13+
"version": "10.3.49",
14+
"commands": [
15+
"fallout"
16+
],
17+
"rollForward": true
18+
}
19+
}
20+
}

‎.fallout/build.schema.json‎

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"definitions": {
4+
"Host": {
5+
"type": "string",
6+
"enum": [
7+
"AppVeyor",
8+
"AzurePipelines",
9+
"Bamboo",
10+
"Bitbucket",
11+
"Bitrise",
12+
"GitHubActions",
13+
"GitLab",
14+
"Jenkins",
15+
"Rider",
16+
"SpaceAutomation",
17+
"TeamCity",
18+
"Terminal",
19+
"TravisCI",
20+
"VisualStudio",
21+
"VSCode"
22+
]
23+
},
24+
"ExecutableTarget": {
25+
"type": "string",
26+
"enum": [
27+
"Pack",
28+
"Test"
29+
]
30+
},
31+
"Verbosity": {
32+
"type": "string",
33+
"description": "",
34+
"enum": [
35+
"Verbose",
36+
"Normal",
37+
"Minimal",
38+
"Quiet"
39+
]
40+
},
41+
"FalloutBuild": {
42+
"properties": {
43+
"Continue": {
44+
"type": "boolean",
45+
"description": "Indicates to continue a previously failed build attempt"
46+
},
47+
"Help": {
48+
"type": "boolean",
49+
"description": "Shows the help text for this build assembly"
50+
},
51+
"Host": {
52+
"description": "Host for execution. Default is 'automatic'",
53+
"$ref": "#/definitions/Host"
54+
},
55+
"NoLogo": {
56+
"type": "boolean",
57+
"description": "Disables displaying the NUKE logo"
58+
},
59+
"Partition": {
60+
"type": "string",
61+
"description": "Partition to use on CI"
62+
},
63+
"Plan": {
64+
"type": "boolean",
65+
"description": "Shows the execution plan (HTML)"
66+
},
67+
"Profile": {
68+
"type": "array",
69+
"description": "Defines the profiles to load",
70+
"items": {
71+
"type": "string"
72+
}
73+
},
74+
"Root": {
75+
"type": "string",
76+
"description": "Root directory during build execution"
77+
},
78+
"Skip": {
79+
"type": "array",
80+
"description": "List of targets to be skipped. Empty list skips all dependencies",
81+
"items": {
82+
"$ref": "#/definitions/ExecutableTarget"
83+
}
84+
},
85+
"Target": {
86+
"type": "array",
87+
"description": "List of targets to be invoked. Default is '{default_target}'",
88+
"items": {
89+
"$ref": "#/definitions/ExecutableTarget"
90+
}
91+
},
92+
"Verbosity": {
93+
"description": "Logging verbosity during build execution. Default is 'Normal'",
94+
"$ref": "#/definitions/Verbosity"
95+
}
96+
}
97+
}
98+
},
99+
"allOf": [
100+
{},
101+
{
102+
"$ref": "#/definitions/FalloutBuild"
103+
}
104+
]
105+
}

‎.fallout/parameters.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"Solution": "Scrutor.Extensions.HttpClient.sln"
3+
}

‎.github/release.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Categorises the auto-generated GitHub Release notes by PR label
2+
# (used by `generate_release_notes` in publish.yml).
3+
changelog:
4+
exclude:
5+
labels:
6+
- duplicate
7+
- invalid
8+
- wontfix
9+
categories:
10+
- title: ✨ Features & Enhancements
11+
labels: [enhancement, feature]
12+
- title: 🐛 Fixes
13+
labels: [bug, fix]
14+
- title: 📝 Documentation
15+
labels: [documentation]
16+
- title: 🔧 Maintenance & CI
17+
labels: [chore, ci, cleanup, dependencies, iac]
18+
- title: Other Changes
19+
labels: ["*"]

‎.github/workflows/build.yml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# ------------------------------------------------------------------------------
2+
# <auto-generated>
3+
#
4+
# This code was generated.
5+
#
6+
# - To turn off auto-generation set:
7+
#
8+
# [GitHubActions (AutoGenerate = false)]
9+
#
10+
# - To trigger manual generation invoke:
11+
#
12+
# fallout --generate-configuration GitHubActions_build --host GitHubActions
13+
#
14+
# </auto-generated>
15+
# ------------------------------------------------------------------------------
16+
17+
name: build
18+
19+
on:
20+
push:
21+
branches:
22+
- main
23+
pull_request:
24+
branches:
25+
- main
26+
27+
jobs:
28+
ubuntu-latest:
29+
name: ubuntu-latest
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v6
33+
with:
34+
fetch-depth: 0
35+
- name: 'Cache: .fallout/temp, ~/.nuget/packages'
36+
uses: actions/cache@v4
37+
with:
38+
path: |
39+
.fallout/temp
40+
~/.nuget/packages
41+
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
42+
- name: 'Run: Test, Pack'
43+
run: ./build.cmd Test Pack

‎.github/workflows/publish-nuget.yml‎

Lines changed: 0 additions & 57 deletions
This file was deleted.

‎.github/workflows/publish.yml‎

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Publish on a version tag:
2+
# 1. NuGet.org via Trusted Publishing (OIDC) — no stored API key.
3+
# 2. GitHub Packages (uses the built-in GITHUB_TOKEN).
4+
# 3. A GitHub Release with the .nupkg file attached and auto-generated,
5+
# label-categorized release notes (see .github/release.yml).
6+
#
7+
# HAND-WRITTEN, documented exception: Fallout owns .github/workflows/build.yml
8+
# (generated from the [GitHubActions] attribute — never hand-edit it), but the
9+
# publish flow (OIDC trusted publishing + GitHub Packages + Release) is not
10+
# expressible via the pinned Fallout 10.3.49 attribute API, so this workflow is
11+
# maintained by hand. See CLAUDE.md.
12+
#
13+
# One-time nuget.org setup: a Trusted Publisher policy for the package
14+
# (Scrutor.Extensions.HttpClient): owner Chrison-dev, repo
15+
# Scrutor.Extensions.HttpClient, workflow publish.yml, environment nuget.org.
16+
# Repo variable NUGET_USER = your nuget.org username.
17+
#
18+
# Triggered by pushing a version tag, e.g. `git tag v5.1.0 && git push origin v5.1.0`.
19+
name: publish
20+
21+
on:
22+
push:
23+
tags: ['v*']
24+
workflow_dispatch:
25+
26+
permissions:
27+
id-token: write # OIDC trusted publishing (nuget.org)
28+
contents: write # create the GitHub Release
29+
packages: write # push to GitHub Packages
30+
31+
jobs:
32+
publish:
33+
runs-on: ubuntu-latest
34+
environment: nuget.org
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0 # GitVersion needs full history
39+
40+
- uses: actions/setup-dotnet@v4
41+
with:
42+
global-json-file: global.json
43+
44+
- name: 'Restore: dotnet tools'
45+
run: dotnet tool restore
46+
47+
- name: 'Pack'
48+
run: dotnet run --project build/_build.csproj -- Pack
49+
50+
- name: 'NuGet.org: trusted-publishing login (OIDC → short-lived key)'
51+
uses: NuGet/login@v1
52+
id: login
53+
with:
54+
user: ${{ vars.NUGET_USER }}
55+
56+
- name: 'NuGet.org: push'
57+
run: >
58+
dotnet nuget push "artifacts/packages/*.nupkg"
59+
--source https://api.nuget.org/v3/index.json
60+
--api-key ${{ steps.login.outputs.NUGET_API_KEY }}
61+
--skip-duplicate
62+
63+
- name: 'GitHub Packages: push'
64+
run: >
65+
dotnet nuget push "artifacts/packages/*.nupkg"
66+
--source https://nuget.pkg.github.com/Chrison-dev/index.json
67+
--api-key ${{ secrets.GITHUB_TOKEN }}
68+
--skip-duplicate
69+
70+
- name: 'GitHub Release: create with packages + generated notes'
71+
if: startsWith(github.ref, 'refs/tags/')
72+
uses: softprops/action-gh-release@v2
73+
with:
74+
files: artifacts/packages/*.nupkg
75+
generate_release_notes: true

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,3 +398,7 @@ FodyWeavers.xsd
398398

399399
# JetBrains Rider
400400
*.sln.iml
401+
402+
# Fallout build system
403+
.fallout/temp/
404+
artifacts/

0 commit comments

Comments
 (0)