Skip to content

Commit d7bb1d1

Browse files
committed
Upgraded to recent versions, migrated to GitHub actions
1 parent 437df89 commit d7bb1d1

50 files changed

Lines changed: 257 additions & 458 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/cla-assistant.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"whitelist": [
3+
"github-copilot[bot]",
4+
"dependabot[bot]",
5+
"github-actions[bot]"
6+
]
7+
}

.github/workflows/build.yml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
name: Build and Deploy
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'gh-pages'
7+
pull_request:
8+
branches-ignore:
9+
- 'gh-pages'
10+
11+
jobs:
12+
build:
13+
runs-on: windows-latest
14+
15+
permissions:
16+
contents: write # Required for pushing to gh-pages
17+
actions: read
18+
checks: write
19+
20+
env:
21+
SOLUTION: 'src/Dapplo.HttpExtensions.sln'
22+
BUILD_PLATFORM: 'Any CPU'
23+
BUILD_CONFIGURATION: 'Release'
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Setup NuGet
32+
uses: nuget/setup-nuget@v2
33+
with:
34+
nuget-version: '7.0.1'
35+
36+
- name: Setup .NET
37+
uses: actions/setup-dotnet@v4
38+
with:
39+
dotnet-version: '10.0.101'
40+
41+
- name: Restore dependencies
42+
run: dotnet restore ${{ env.SOLUTION }}
43+
44+
- name: Test
45+
run: dotnet test ${{ env.SOLUTION }} --configuration ${{ env.BUILD_CONFIGURATION }} /p:Platform="${{ env.BUILD_PLATFORM}}" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
46+
47+
- name: Build
48+
run: dotnet build ${{ env.solution }} --configuration ${{ env.BUILD_CONFIGURATION }} /p:Platform="${{ env.BUILD_PLATFORM }}" --no-restore
49+
50+
- name: Upload coverage to Codecov
51+
if: github.event_name != 'pull_request'
52+
uses: codecov/codecov-action@v5
53+
with:
54+
files: src/**/coverage.cobertura.xml
55+
token: ${{ secrets.CODECOV_TOKEN }}
56+
slug: dapplo/Dapplo.HttpExtensions
57+
fail_ci_if_error: false
58+
59+
- name: Install DocFX
60+
run: choco install docfx -y
61+
62+
- name: Build Documentation
63+
run: docfx doc/docfx.json
64+
65+
- name: Copy NuGet packages to artifacts
66+
shell: pwsh
67+
run: |
68+
New-Item -ItemType Directory -Force -Path artifacts
69+
Get-ChildItem -Path src -Include "*.nupkg" -Recurse -File | Where-Object { $_.FullName -match "\\bin\\${{ env.BUILD_CONFIGURATION }}\\" } | Copy-Item -Destination artifacts
70+
71+
- name: Copy coverage files to artifacts
72+
shell: pwsh
73+
run: |
74+
Get-ChildItem -Path src -Include "coverage.*" -Recurse -File | Copy-Item -Destination artifacts
75+
continue-on-error: true
76+
77+
- name: Upload build artifacts
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: build-artifacts
81+
path: artifacts/**/*
82+
83+
- name: Upload documentation site
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: documentation-site
87+
path: doc/_site/**/*
88+
89+
- name: Publish documentation to gh-pages
90+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
91+
shell: cmd
92+
run: |
93+
git config --local user.name "github-actions[bot]"
94+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
95+
git config --local core.autocrlf false
96+
git config --local core.safecrlf false
97+
git checkout -B docfx
98+
del .gitignore
99+
git add doc/_site
100+
git commit -m "Generated documentation for ${{ github.run_number }}"
101+
git subtree split --prefix doc/_site -b gh-pages
102+
git push -f origin gh-pages:gh-pages
103+
104+
deploy:
105+
runs-on: windows-latest
106+
needs: build
107+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
108+
permissions:
109+
contents: read
110+
111+
environment:
112+
name: NuGet
113+
114+
steps:
115+
- name: Download build artifacts
116+
uses: actions/download-artifact@v4
117+
with:
118+
name: build-artifacts
119+
path: artifacts
120+
121+
- name: Setup NuGet
122+
uses: NuGet/setup-nuget@v2
123+
with:
124+
nuget-version: '7.0.1'
125+
126+
- name: Push to NuGet
127+
shell: pwsh
128+
run: |
129+
$packages = Get-ChildItem -Path artifacts -Filter "*.nupkg" | Where-Object { $_.Name -notlike "*.symbols.nupkg" }
130+
if ($packages.Count -eq 0) {
131+
Write-Host "No packages found to publish"
132+
exit 0
133+
}
134+
135+
$failed = 0
136+
foreach ($package in $packages) {
137+
Write-Host "Pushing $($package.Name)..."
138+
$result = & nuget push $package.FullName -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_API_KEY }} -SkipDuplicate 2>&1
139+
if ($LASTEXITCODE -ne 0) {
140+
if ($result -match "already exists") {
141+
Write-Host "Package already exists (skipped): $($package.Name)"
142+
} else {
143+
Write-Error "Failed to push $($package.Name): $result"
144+
$failed++
145+
}
146+
} else {
147+
Write-Host "Successfully pushed: $($package.Name)"
148+
}
149+
}
150+
151+
if ($failed -gt 0) {
152+
Write-Error "Failed to push $failed package(s)"
153+
exit 1
154+
}

azure-pipelines.yml

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

src/Dapplo.HttpExtensions.JsonNet/Dapplo.HttpExtensions.JsonNet.csproj

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<Description>Json.NET functionality for Dapplo.HttpExtensions</Description>
4-
<TargetFrameworks>net471;netstandard1.3;netstandard2.0;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net481;netstandard2.0;net10.0</TargetFrameworks>
55
<PackageTags>http;rest;dapplo</PackageTags>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="Dapplo.Log" Version="2.0.1" />
9-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
8+
<PackageReference Include="Dapplo.Log" Version="3.0.17" />
9+
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
1010
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
1111
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.7.0" />
1212
</ItemGroup>
1313
<ItemGroup>
1414
<ProjectReference Include="..\Dapplo.HttpExtensions\Dapplo.HttpExtensions.csproj" />
1515
</ItemGroup>
16-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
17-
<PackageReference Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" />
18-
<PackageReference Include="System.Collections.Concurrent" Version="4.3.0" />
19-
<PackageReference Include="System.ComponentModel" Version="4.3.0" />
20-
<PackageReference Include="System.ComponentModel.Primitives" Version="4.3.0" />
21-
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
22-
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
23-
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
24-
<PackageReference Include="System.ObjectModel" Version="4.3.0" />
25-
<PackageReference Include="System.Reflection" Version="4.3.0" />
26-
<PackageReference Include="System.Runtime.Extensions" Version="4.3.1" />
27-
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
28-
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
29-
</ItemGroup>
30-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
31-
<PackageReference Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" />
32-
<PackageReference Include="System.Collections.Concurrent" Version="4.3.0" />
33-
<PackageReference Include="System.ComponentModel" Version="4.3.0" />
34-
<PackageReference Include="System.ComponentModel.Primitives" Version="4.3.0" />
35-
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
36-
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
37-
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
38-
<PackageReference Include="System.ObjectModel" Version="4.3.0" />
39-
<PackageReference Include="System.Reflection" Version="4.3.0" />
40-
<PackageReference Include="System.Runtime.Extensions" Version="4.3.1" />
41-
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
42-
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
43-
</ItemGroup>
4416
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
4517
<Reference Include="System" />
4618
<Reference Include="Microsoft.CSharp" />

0 commit comments

Comments
 (0)