Skip to content

Commit 3676cd4

Browse files
authored
Update for net10.0 sdk (#189)
* Get building on .NET 10.0 SDK * Update spec and benchmark TargetFrameworks * Move from AzureDevOps to GHA build Note that we aren't changing the core library itself because we don't really have any reason to change that in any way: it works fine on .NET 10.0 as is, so we aren't producing a new release for now. (If/when we modify this library, then we likely will bump the target versions because there's no need to release a new version of a library targetting out-of-support runtimes.)
1 parent 44ef008 commit 3676cd4

File tree

11 files changed

+272
-749
lines changed

11 files changed

+272
-749
lines changed

.github/workflows/build.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags:
7+
- '*'
8+
pull_request:
9+
branches:
10+
- master
11+
workflow_dispatch:
12+
inputs:
13+
forcePublish:
14+
description: When true the Publish stage will always be run, otherwise it only runs for tagged versions.
15+
required: false
16+
default: false
17+
type: boolean
18+
skipCleanup:
19+
description: When true the pipeline clean-up stage will not be run. For example, the cache used between pipeline stages will be retained.
20+
required: false
21+
default: false
22+
type: boolean
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.sha }}
26+
cancel-in-progress: true
27+
28+
permissions:
29+
actions: write # enable cache clean-up
30+
checks: write # enable test result annotations
31+
contents: write # enable creating releases
32+
issues: read
33+
packages: write # enable publishing packages
34+
pull-requests: write # enable test result annotations
35+
36+
jobs:
37+
prepareConfig:
38+
name: Prepare Configuration
39+
runs-on: ubuntu-latest
40+
outputs:
41+
RESOLVED_ENV_VARS: ${{ steps.prepareEnvVarsAndSecrets.outputs.environmentVariablesYamlBase64 }}
42+
RESOLVED_SECRETS: ${{ steps.prepareEnvVarsAndSecrets.outputs.secretsYamlBase64 }}
43+
steps:
44+
# Declare any environment variables and/or secrets that need to be available inside the build process
45+
- uses: endjin/Endjin.RecommendedPractices.GitHubActions/actions/prepare-env-vars-and-secrets@main
46+
id: prepareEnvVarsAndSecrets
47+
with:
48+
environmentVariablesYaml: |
49+
BUILDVAR_NuGetPublishSource: "${{ startsWith(github.ref, 'refs/tags/') && 'https://api.nuget.org/v3/index.json' || format('https://nuget.pkg.github.com/{0}/index.json', github.repository_owner) }}"
50+
secretsYaml: |
51+
NUGET_API_KEY: "${{ startsWith(github.ref, 'refs/tags/') && secrets.NUGET_APIKEY || secrets.BUILD_PUBLISHER_PAT }}"
52+
secretsEncryptionKey: ${{ secrets.SHARED_WORKFLOW_KEY }}
53+
54+
build:
55+
needs: prepareConfig
56+
uses: endjin/Endjin.RecommendedPractices.GitHubActions/.github/workflows/scripted-build-matrix-pipeline.yml@main
57+
with:
58+
netSdkVersion: '10.0.x'
59+
additionalNetSdkVersion: '9.0.x'
60+
# workflow_dispatch inputs are always strings, the type property is just for the UI
61+
forcePublish: ${{ github.event.inputs.forcePublish == 'true' }}
62+
skipCleanup: ${{ github.event.inputs.skipCleanup == 'true' }}
63+
# testArtifactName: ''
64+
# testArtifactPath: ''
65+
compilePhaseEnv: ${{ needs.prepareConfig.outputs.RESOLVED_ENV_VARS }}
66+
testPhaseEnv: ${{ needs.prepareConfig.outputs.RESOLVED_ENV_VARS }}
67+
packagePhaseEnv: ${{ needs.prepareConfig.outputs.RESOLVED_ENV_VARS }}
68+
publishPhaseEnv: ${{ needs.prepareConfig.outputs.RESOLVED_ENV_VARS }}
69+
additionalCachePaths: |
70+
JSON-Schema-Test-Suite
71+
secrets:
72+
compilePhaseAzureCredentials: ${{ secrets.AZURE_READER_CREDENTIALS }}
73+
# testPhaseAzureCredentials: ${{ secrets.TESTS_KV_READER_CREDENTIALS }}
74+
# packagePhaseAzureCredentials: ${{ secrets.AZURE_PUBLISH_CREDENTIALS }}
75+
# publishPhaseAzureCredentials: ${{ secrets.AZURE_PUBLISH_CREDENTIALS }}
76+
# compilePhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
77+
# testPhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
78+
# packagePhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
79+
publishPhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
80+
secretsEncryptionKey: ${{ secrets.SHARED_WORKFLOW_KEY }}

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,15 @@ ASALocalRun/
334334

335335
# Cobertura code coverage file
336336
coverage.cobertura.xml
337+
/_codeCoverage/**
337338

338339
# VS Code config files
339340
/.vscode
340341

341342
# Generated SpecFlow files
342-
*.feature.cs
343+
*.feature.cs
344+
345+
# SBOMs
346+
*.sbom.*
347+
348+
_packages/**

Solutions/Ais.Net.Benchmarks/Ais.Net.Benchmarks.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<Import Project="..\Common.Net.proj" />
@@ -18,7 +18,7 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
21+
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
2222
</ItemGroup>
2323

2424
<ItemGroup>

Solutions/Ais.Net.Specs/Ais.Net.Specs.csproj

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<Import Project="..\Common.Net.proj" />
@@ -15,7 +15,7 @@
1515
<NoWarn>RCS1029;RCS1089;SA1600;CS1591;SA1633;SA1649</NoWarn>
1616
</PropertyGroup>
1717
<ItemGroup>
18-
<PackageReference Include="System.Memory" Version="4.5.4" />
18+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1919
<PackageReference Include="Corvus.Testing.SpecFlow.NUnit" Version="1.6.0" />
2020
</ItemGroup>
2121
<ItemGroup>
@@ -79,15 +79,5 @@
7979
<AutoGen>True</AutoGen>
8080
<DependentUpon>NmeaStreamParserByMessageSpecs.feature</DependentUpon>
8181
</Compile>
82-
<Compile Update="Ais\Net\Specs\ParsePayloadSpecs.feature.cs">
83-
<DesignTime>True</DesignTime>
84-
<AutoGen>True</AutoGen>
85-
<DependentUpon>ParsePayloadSpecs.feature</DependentUpon>
86-
</Compile>
87-
<Compile Update="Ais\Net\Specs\SentenceLayerSpecs.feature.cs">
88-
<DesignTime>True</DesignTime>
89-
<AutoGen>True</AutoGen>
90-
<DependentUpon>SentenceLayerSpecs.feature</DependentUpon>
91-
</Compile>
9282
</ItemGroup>
9383
</Project>

Solutions/Ais.Net.Specs/Ais/Net/Specs/ParsePayloadSpecs.feature.cs

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

0 commit comments

Comments
 (0)