Skip to content

Commit 1723f70

Browse files
committed
chore: overhaul releasing workflow, supported frameworks
1 parent d0d007c commit 1723f70

File tree

17 files changed

+917
-3311
lines changed

17 files changed

+917
-3311
lines changed

.github/workflows/ci.yml

Lines changed: 120 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,50 @@ jobs:
1010
lint:
1111
runs-on: windows-latest
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v5
1414

1515
- name: Install .NET SDK
16-
uses: actions/setup-dotnet@v4
16+
uses: actions/setup-dotnet@v5
1717
with:
18-
dotnet-version: 9.x.x
18+
dotnet-version: 10.x.x
1919

2020
- name: Set up dotnet tools
21-
run: make install-tools
21+
run: make install install-styleguide
2222

2323
- name: Check style with dotnet-format
2424
run: make lint
2525

26+
Roslyn_Static_Analysis:
27+
runs-on: windows-latest
28+
steps:
29+
- uses: actions/checkout@v5
30+
31+
- name: Install .NET SDK
32+
uses: actions/setup-dotnet@v5
33+
with:
34+
dotnet-version: 10.x.x
35+
36+
- name: Set up dotnet tools
37+
run: make install install-styleguide
38+
39+
- name: Restore NuGet Packages
40+
run: make restore
41+
42+
# This Make step is configured to treat all warnings as errors, so it will fail if any warnings are found
43+
- name: Run static analysis
44+
run: make analyze
45+
2646
Security_Code_Scan:
2747
runs-on: windows-latest
2848
steps:
29-
- uses: actions/checkout@v4
49+
- uses: actions/checkout@v5
3050

3151
- name: Install .NET SDK
32-
uses: actions/setup-dotnet@v4
52+
uses: actions/setup-dotnet@v5
3353
with:
3454
# v6 is needed for the tool to run
3555
dotnet-version: |
36-
9.x.x
56+
10.x.x
3757
6.x.x
3858
3959
- name: Set up dotnet tools and dependencies
@@ -45,12 +65,12 @@ jobs:
4565
Coverage_Requirements:
4666
runs-on: ubuntu-latest
4767
steps:
48-
- uses: actions/checkout@v4
68+
- uses: actions/checkout@v5
4969

5070
- name: Install .NET SDK
51-
uses: actions/setup-dotnet@v4
71+
uses: actions/setup-dotnet@v5
5272
with:
53-
dotnet-version: 9.x.x
73+
dotnet-version: 10.x.x
5474

5575
- name: Set up dotnet tools and dependencies
5676
run: make install
@@ -62,12 +82,12 @@ jobs:
6282
if: github.ref == 'refs/heads/master'
6383
runs-on: ubuntu-latest
6484
steps:
65-
- uses: actions/checkout@v4
85+
- uses: actions/checkout@v5
6686

6787
- name: Install .NET SDK
68-
uses: actions/setup-dotnet@v4
88+
uses: actions/setup-dotnet@v5
6989
with:
70-
dotnet-version: 9.x.x
90+
dotnet-version: 10.x.x
7191

7292
- name: Set up dotnet tools and dependencies
7393
run: make install
@@ -86,44 +106,38 @@ jobs:
86106
runs-on: windows-latest
87107
strategy:
88108
matrix:
89-
name: ['net462', 'netstandard2.0', 'netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0', 'net8.0', 'net9.0']
109+
name: ['Net60', 'Net70', 'Net80', 'Net90', 'Net100']
90110
include:
91-
- name: net462
92-
framework: net462
93-
dotnet-version: null
94-
- name: netstandard2.0
95-
# can't run tests on .NET Standard, it's just a bridge between .NET Framework and .NET.
96-
# So we'll target .NET Framework 4.6.2
97-
# More notes at the bottom of this file
98-
framework: net462
99-
dotnet-version: null
100-
- name: netcoreapp3.1
101-
framework: netcoreapp3.1
102-
dotnet-version: 3.1.x
103-
- name: net5.0
104-
framework: net5.0
105-
dotnet-version: 5.x.x
106-
- name: net6.0
111+
- name: Net60
107112
framework: net6.0
108113
dotnet-version: 6.x.x
109-
- name: net7.0
114+
- name: Net70
110115
framework: net7.0
111116
dotnet-version: 7.x.x
112-
- name: net8.0
117+
- name: Net80
113118
framework: net8.0
114119
dotnet-version: 8.x.x
115-
- name: net9.0
120+
- name: Net90
116121
framework: net9.0
117122
dotnet-version: 9.x.x
123+
- name: Net100
124+
framework: net10.0
125+
dotnet-version: 10.x.x
118126
steps:
119-
- uses: actions/checkout@v4
127+
- uses: actions/checkout@v5
120128
with:
121129
submodules: true
122130

123131
- name: Install .NET SDK
124-
uses: actions/setup-dotnet@v4
132+
uses: actions/setup-dotnet@v5
125133
with:
126-
dotnet-version: ${{ matrix.dotnet-version}}
134+
dotnet-version: |
135+
10.x.x
136+
${{ matrix.dotnet-version }}
137+
138+
- name: Specify .NET SDK version to use since GitHub runners have multiple installed
139+
run: |
140+
echo '{"sdk":{"version": "${{ matrix.dotnet-version }}"}}' > ./global.json
127141
128142
- name: Setup MSBuild
129143
uses: microsoft/setup-msbuild@v2
@@ -148,19 +162,71 @@ jobs:
148162

149163
# Run the unit tests in a specific framework (verify that the library works in that framework)
150164
- name: Run Tests
151-
run: make test-fw fw=${{ matrix.framework }}
165+
run: make unit-test FW=${{ matrix.framework }}
166+
167+
# .NET Standard notes:
168+
# - NET Standard 2.0 is compatible with minimum .NET Framework 4.6.1: https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0
169+
# - GitHub's Windows 2022 runner only supports minimum .NET Framework 4.7.2 anyway: https://github.com/actions/virtual-environments/issues/5055#issuecomment-1040757930
170+
# - .NET Standard is not a framework, but a set of shared APIs between the old .NET Framework and new .NET/.NET Core
171+
# - `EasyPost` targets .NET Standard 2.0, meaning it is compatible with specific versions of both .NET and .NET Framework: https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0
172+
# - When you want to actually run code, however, you can't run it in .NET Standard. You have to run it in either .NET or .NET Framework: https://stackoverflow.com/a/48885500/13343799
173+
# - So, while `EasyPost` targets .NET Standard 2.0, `EasyPost.Compatibility.NetStandard`, the code we're actually executing, targets .NET Framework 4.7.2
174+
# - By extension, this is ensuring we are testing that the `EasyPost` source code can run in a .NET Framework environment
175+
176+
NetStandard_Compatibility_Tests:
177+
# Need windows-2022 for .NET Framework 4.7.2 support
178+
runs-on: windows-2022
179+
steps:
180+
- uses: actions/checkout@v5
181+
with:
182+
submodules: true
183+
184+
- name: Install .NET SDK
185+
uses: actions/setup-dotnet@v5
186+
id: setupid
187+
with:
188+
dotnet-version: 10.x.x
189+
190+
- name: Specify .NET SDK version to use since GitHub runners have multiple installed
191+
run: |
192+
echo '{"sdk":{"version": "${{ steps.setupid.outputs.dotnet-version }}"}}' > ./global.json
193+
194+
- name: Setup MSBuild
195+
uses: microsoft/setup-msbuild@v2
196+
197+
- name: Setup Nuget
198+
uses: NuGet/setup-nuget@v2
199+
200+
- name: Setup VSTest
201+
uses: darenm/Setup-VSTest@v1.3
202+
203+
# Pull in fixtures submodule
204+
- name: Set up dotnet tools and dependencies
205+
run: make install
206+
207+
- name: Restore NuGet Packages
208+
run: make restore build
209+
210+
# Run the compatibility tests
211+
- name: Run Tests
212+
run: make netstandard-compat-test FW=net472
152213

153-
FSharp_Compatibility:
214+
FSharp_Compatibility_Tests:
154215
runs-on: windows-latest
155216
steps:
156-
- uses: actions/checkout@v4
217+
- uses: actions/checkout@v5
157218
with:
158219
submodules: true
159220

160221
- name: Install .NET SDK
161-
uses: actions/setup-dotnet@v4
222+
uses: actions/setup-dotnet@v5
223+
id: setupid
162224
with:
163-
dotnet-version: 9.x.x
225+
dotnet-version: 10.x.x
226+
227+
- name: Specify .NET SDK version to use since GitHub runners have multiple installed
228+
run: |
229+
echo '{"sdk":{"version": "${{ steps.setupid.outputs.dotnet-version }}"}}' > ./global.json
164230
165231
- name: Setup MSBuild
166232
uses: microsoft/setup-msbuild@v2
@@ -178,21 +244,26 @@ jobs:
178244
- name: Set up dotnet tools and dependencies
179245
run: make install
180246

181-
# Build the test project
182-
- name: Build Solution
247+
# Run the compatibility tests
248+
- name: Run Tests
183249
run: make fs-compat-test
184250

185-
Visual_Basic_Compatibility:
251+
Visual_Basic_Compatibility_Test:
186252
runs-on: windows-latest
187253
steps:
188-
- uses: actions/checkout@v4
254+
- uses: actions/checkout@v5
189255
with:
190256
submodules: true
191257

192258
- name: Install .NET SDK
193-
uses: actions/setup-dotnet@v4
259+
uses: actions/setup-dotnet@v5
260+
id: setupid
194261
with:
195-
dotnet-version: 9.x.x
262+
dotnet-version: 10.x.x
263+
264+
- name: Specify .NET SDK version to use since GitHub runners have multiple installed
265+
run: |
266+
echo '{"sdk":{"version": "${{ steps.setupid.outputs.dotnet-version }}"}}' > ./global.json
196267
197268
- name: Setup MSBuild
198269
uses: microsoft/setup-msbuild@v2
@@ -210,15 +281,6 @@ jobs:
210281
- name: Set up dotnet tools and dependencies
211282
run: make install
212283

213-
# Build the test project
214-
- name: Build Solution
284+
# Run the compatibility tests
285+
- name: Run Tests
215286
run: make vb-compat-test
216-
# .NET Standard notes:
217-
# - NET Standard 2.0 is compatible with minimum .NET Framework 4.6.1: https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0
218-
# - NET Framework 4.6.1 is EOL after April 26, 2022, due to its security concerns (was affected by the SHA-1 crack): https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-framework
219-
# - GitHub's Windows 2022 runner only supports minimum .NET Framework 4.6.2 anyway: https://github.com/actions/virtual-environments/issues/5055#issuecomment-1040757930
220-
# - .NET Standard is not a framework, but a set of shared APIs between the old .NET Framework and new .NET/.NET Core
221-
# - `EasyVCR` targets .NET Standard 2.0, meaning it is compatible with specific versions of both .NET and .NET Framework: https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0
222-
# - When you want to actually run code, however, you can't run it in .NET Standard. You have to run it in either .NET or .NET Framework: https://stackoverflow.com/a/48885500/13343799
223-
# - So, while `EasyVCR` targets .NET Standard 2.0, `EasyVCR.Tests`, the code we're actually executing, targets .NET Framework 4.6.2
224-
# - By extension, this is ensuring we are testing that the `EasyVCR` source code can run in a .NET Framework environment

.github/workflows/release.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,25 @@ name: Release
33
on:
44
release:
55
types: [published]
6-
workflow_dispatch:
6+
workflow_dispatch: ~
77

88
jobs:
99
publish:
1010
name: Publish to NuGet
1111
runs-on: windows-latest
1212
steps:
1313
- name: Checkout repository
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515

1616
- name: Install .NET SDK
17-
uses: actions/setup-dotnet@v4
17+
uses: actions/setup-dotnet@v5
1818
with:
1919
dotnet-version: |
20-
3.1.x
21-
5.x.x
2220
6.x.x
2321
7.x.x
2422
8.x.x
2523
9.x.x
24+
10.x.x
2625
2726
- name: Setup Nuget
2827
uses: NuGet/setup-nuget@v2
@@ -66,15 +65,13 @@ jobs:
6665

6766
- name: Build and Sign NuGet package
6867
run: |
69-
call scripts\win\build_release_nuget.bat EasyVCR EasyPostNETStrongNameSigning.snk "${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}" Release
68+
call scripts\win\build_release_nuget.bat EasyVCR EasyPostNETStrongNameSigning.snk "${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}" "${{ secrets.SM_CODE_SIGNING_CERT_SHA256_HASH }}" Release
7069
shell: cmd
7170

7271
- name: Publish to NuGet
7372
run: make publish key=${{ secrets.NUGET_API_KEY }}
7473

75-
# If triggered by a release, upload the NuGet package to the release
7674
- name: Upload NuGet package to release
77-
if: github.event_name == 'release'
7875
uses: AButler/upload-release-assets@v3.0.1
7976
with:
8077
files: '*.nupkg'

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## Next Release
4+
5+
- Drops support for `netcoreapp3.1` and `net5.0`
6+
- Adds support for `net10.0`
7+
38
## v0.12.0 (2025-04-21)
49

510
- Add support for censoring XML, HTML and plain text bodies

0 commit comments

Comments
 (0)