Skip to content

Commit aaad9b1

Browse files
committed
Update project files and workflows for .NET 8.0 and 9.0 compatibility
1 parent 88eb98a commit aaad9b1

File tree

6 files changed

+71
-11
lines changed

6 files changed

+71
-11
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release Package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**.csproj'
9+
- '**.cs'
10+
- '**.yaml'
11+
12+
jobs:
13+
release-github:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: |
25+
9.0.x
26+
8.0.x
27+
7.0.x
28+
6.0.x
29+
cache: true
30+
cache-dependency-path: '**/packages.lock.json'
31+
32+
- uses: dotnet/nbgv@master
33+
id: nbgv
34+
35+
- name: Restore dependencies
36+
run: dotnet restore --locked-mode
37+
38+
- name: Build
39+
run: dotnet build --no-restore -c Release
40+
41+
- name: Generate Nuget Package
42+
run: dotnet pack --no-build -c Release --output ./artifacts
43+
44+
- name: Create Release
45+
id: create_release
46+
uses: softprops/action-gh-release@v1
47+
with:
48+
tag_name: ${{ steps.nbgv.outputs.NuGetPackageVersion }}
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: Upload NuGet Package to Release
53+
uses: softprops/action-gh-release@v1
54+
with:
55+
files: ./artifacts/*.nupkg
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: .NET Build, Test, and Publish
1+
name: Release Package
22

33
on:
4-
workflow_dispatch:
4+
workflow_dispatch:
55

66
jobs:
7-
release:
7+
release-nuget:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout repository
@@ -15,7 +15,11 @@ jobs:
1515
- name: Setup .NET
1616
uses: actions/setup-dotnet@v4
1717
with:
18-
dotnet-version: '8.0.x'
18+
dotnet-version: |
19+
9.0.x
20+
8.0.x
21+
7.0.x
22+
6.0.x
1923
cache: true
2024
cache-dependency-path: '**/packages.lock.json'
2125

@@ -25,9 +29,6 @@ jobs:
2529
- name: Build
2630
run: dotnet build --no-restore -c Release
2731

28-
- name: Run tests
29-
run: dotnet test --no-build -c Release
30-
3132
- name: Generate Nuget Package
3233
run: dotnet pack --no-build -c Release --output ./artifacts
3334

.github/workflows/test.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
- name: Setup .NET
2121
uses: actions/setup-dotnet@v4
2222
with:
23-
dotnet-version: '8.0.x'
23+
dotnet-version: |
24+
9.0.x
25+
8.0.x
2426
cache: true
2527
cache-dependency-path: '**/packages.lock.json'
2628

tests/BlazorLocalTimeTest/BlazorLocalTimeTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22
<PropertyGroup>
3-
<TargetFramework>net9.0</TargetFramework>
3+
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
<IsPackable>false</IsPackable>

tests/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77
<ItemGroup>
88
<PackageReference Include="Shouldly" Version="4.*" />
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.*" />
1010
<PackageReference Include="xunit" Version="2.*" />
1111
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
1212
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "0.6-alpha.{height}",
3+
"version": "0.1-alpha.{height}",
44
"nuGetPackageVersion": {
55
"semVer": 2.0
66
},

0 commit comments

Comments
 (0)