Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2aff18a
Add streaming support and harden client request handling
Mako88 May 30, 2026
866474e
Bump version to 4.2.0
Mako88 May 30, 2026
e09669e
Update test project to net10.0
Mako88 May 30, 2026
14ef029
Add ISimpleClientFactory and register ISimpleClient as transient
Mako88 May 30, 2026
ee9fbd5
Multi-target net8.0 and use SocketsHttpHandler on modern runtimes
Mako88 May 30, 2026
e37615a
Bump WireMock.Net to 2.7.0 to clear vulnerability warnings
Mako88 May 30, 2026
93656ce
Add CI and release GitHub Actions workflows
Mako88 May 30, 2026
ddb1d0c
Make timeout tests deterministic with a delayed WireMock response
Mako88 May 30, 2026
3a158fa
Extract HttpClient lifetime handling into IHttpClientProvider
Mako88 May 30, 2026
e3978d3
Test the netstandard2.0 asset on .NET Framework (net48)
Mako88 May 30, 2026
1bf4f14
Replace release trigger with manual dispatch + PR-merge-by-label
Mako88 May 30, 2026
fa154b1
Actually multi-target the test project to net10.0;net48
Mako88 May 30, 2026
9be59d8
Fix net48 compile and make the net48 CI job non-blocking
Mako88 May 30, 2026
1ec626c
Use new HttpMethod("PATCH") for net48 compatibility
Mako88 May 30, 2026
00b6622
Make net48 tests green and promote the job to a required gate
Mako88 May 30, 2026
52f013e
Surface a clear error for GET-with-body on .NET Framework
Mako88 May 30, 2026
f986932
Wire SimpleClient onto IHttpClientProvider; reflect sent request; rea…
Mako88 May 30, 2026
c41af27
Simplify HttpClient providers
Mako88 May 30, 2026
723c553
Honor stream cancellation token in reads; add opt-in System.Text.Json…
Mako88 May 30, 2026
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
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: [ main ]
pull_request:

jobs:
# Exercises the library's net8.0 asset (modern SocketsHttpHandler path).
test-modern:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
10.0.x

- name: Test (net10.0)
run: dotnet test src/SimpleHttpClient.Tests.Integration/SimpleHttpClient.Tests.csproj -c Release -f net10.0

# Exercises the library's netstandard2.0 asset (rotating path + .NET Framework branch)
# that .NET Framework consumers actually receive. Requires a Windows runner.
test-netfx:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
10.0.x

- name: Test (net48)
run: dotnet test src/SimpleHttpClient.Tests.Integration/SimpleHttpClient.Tests.csproj -c Release -f net48
134 changes: 134 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: Release

# Publishes to NuGet either:
# - manually (Actions > Release > Run workflow), choosing the semver part to bump, or
# - automatically when a PR is merged to main carrying a release:major|minor|patch label.
#
# The version is computed by bumping the latest v* git tag (falling back to the csproj
# <Version> when no tag exists yet), so <Version> never has to be edited by hand. Each
# successful publish creates the matching v<version> tag and a GitHub Release.
#
# Requires a repository secret NUGET_API_KEY (Settings > Secrets and variables > Actions)
# with push rights for the SimpleHttpClient package.
#
# First-time setup: seed a tag matching the last published version so the first bump is
# correct, e.g. git tag v4.1.0 && git push origin v4.1.0

on:
workflow_dispatch:
inputs:
bump:
description: 'Semver part to bump'
required: true
default: patch
type: choice
options: [patch, minor, major]
pull_request:
types: [closed]
branches: [main]

concurrency:
group: release
cancel-in-progress: false

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
10.0.x

# Decide whether to publish and which part to bump.
- name: Determine bump
id: bump
env:
EVENT: ${{ github.event_name }}
INPUT_BUMP: ${{ github.event.inputs.bump }}
MERGED: ${{ github.event.pull_request.merged }}
LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
shell: bash
run: |
set -euo pipefail
if [ "$EVENT" = "workflow_dispatch" ]; then
echo "bump=$INPUT_BUMP" >> "$GITHUB_OUTPUT"
echo "proceed=true" >> "$GITHUB_OUTPUT"
exit 0
fi
# pull_request closed: only on a real merge carrying a release label
if [ "$MERGED" != "true" ]; then
echo "Not a merge; skipping."
echo "proceed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
bump=""
for l in $(echo "$LABELS" | python3 -c "import sys,json; print(' '.join(json.load(sys.stdin)))"); do
case "$l" in
release:major) bump=major ;;
release:minor) bump=minor ;;
release:patch) bump=patch ;;
esac
done
if [ -z "$bump" ]; then
echo "No release:* label on the merged PR; skipping publish."
echo "proceed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "bump=$bump" >> "$GITHUB_OUTPUT"
echo "proceed=true" >> "$GITHUB_OUTPUT"

- name: Compute version
if: steps.bump.outputs.proceed == 'true'
id: version
shell: bash
run: |
set -euo pipefail
latest="$(git tag --list 'v*' --sort=-v:refname | head -n1)"
if [ -z "$latest" ]; then
base="$(grep -oPm1 '(?<=<Version>)[^<]+' src/SimpleHttpClient/SimpleHttpClient.csproj)"
else
base="${latest#v}"
fi
IFS='.' read -r MA MI PA <<< "$base"
case "${{ steps.bump.outputs.bump }}" in
major) MA=$((MA+1)); MI=0; PA=0 ;;
minor) MI=$((MI+1)); PA=0 ;;
patch) PA=$((PA+1)) ;;
esac
newver="$MA.$MI.$PA"
echo "version=$newver" >> "$GITHUB_OUTPUT"
echo "Releasing $newver (base $base, bump ${{ steps.bump.outputs.bump }})"

- name: Test
if: steps.bump.outputs.proceed == 'true'
run: dotnet test src/SimpleHttpClient.Tests.Integration/SimpleHttpClient.Tests.csproj -c Release -f net10.0

# GeneratePackageOnBuild is enabled, so a Release build emits the .nupkg.
- name: Build package
if: steps.bump.outputs.proceed == 'true'
run: dotnet build src/SimpleHttpClient/SimpleHttpClient.csproj -c Release -p:Version=${{ steps.version.outputs.version }}

- name: Push to NuGet
if: steps.bump.outputs.proceed == 'true'
run: dotnet nuget push "src/SimpleHttpClient/bin/Release/*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate

- name: Tag and create GitHub Release
if: steps.bump.outputs.proceed == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
tag="v${{ steps.version.outputs.version }}"
git tag "$tag"
git push origin "$tag"
gh release create "$tag" --title "$tag" --generate-notes
Loading
Loading