Skip to content

Commit

Permalink
chore(sdk): bump the project to .net 9 (#607)
Browse files Browse the repository at this point in the history
* chore(sdk): bump the project to .net 9
  • Loading branch information
hoangthanh28 authored Jan 19, 2025
1 parent 5e5c178 commit 9549a12
Show file tree
Hide file tree
Showing 30 changed files with 555 additions and 562 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
#is-release: 'true'

steps:
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -44,10 +44,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down Expand Up @@ -85,10 +85,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x

- name: Restore dependencies
run: dotnet restore
Expand All @@ -115,13 +115,13 @@ jobs:
]
steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x

- name: Publish self-contained ${{ matrix.arch }}
run: dotnet publish ./src/grate/grate.csproj -f net8.0 -r ${{ matrix.arch }} -c release --self-contained -p:SelfContained=true -o ./publish/${{ matrix.arch }}/self-contained
run: dotnet publish ./src/grate/grate.csproj -f net9.0 -r ${{ matrix.arch }} -c release --self-contained -p:SelfContained=true -o ./publish/${{ matrix.arch }}/self-contained
env:
VERSION: ${{ needs.set-version-number.outputs.nuGetVersion }}

Expand Down Expand Up @@ -151,13 +151,13 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x

- name: Publish self-contained ${{ matrix.arch }}
run: dotnet publish ./src/grate/grate.csproj -f net8.0 -r ${{ matrix.arch }} -c release --self-contained -p:SelfContained=true -o ./publish/${{ matrix.arch }}/self-contained
run: dotnet publish ./src/grate/grate.csproj -f net9.0 -r ${{ matrix.arch }} -c release --self-contained -p:SelfContained=true -o ./publish/${{ matrix.arch }}/self-contained
env:
VERSION: ${{ needs.set-version-number.outputs.nuGetVersion }}

Expand Down Expand Up @@ -294,10 +294,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Test
run: >
dotnet test
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Restore dependencies
run: |
dotnet restore -r linux-x64 grate.sln
- name: Build
run: dotnet build -f net8.0 --no-restore --no-self-contained -r linux-x64 src/grate/grate.csproj -c release
run: dotnet build -f net9.0 --no-restore --no-self-contained -r linux-x64 src/grate/grate.csproj -c release


analyze:
Expand All @@ -44,13 +44,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
9.0.x
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand All @@ -75,10 +76,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Test
run: |
dotnet test \
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
#is-release: 'true'

steps:
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -64,13 +64,13 @@ jobs:
# - osx-x64
steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x

- name: Publish self-contained ${{ matrix.arch }}
run: dotnet publish ./src/grate/grate.csproj -f net8.0 -r ${{ matrix.arch }} -c release --self-contained -p:SelfContained=true -o ./publish/${{ matrix.arch }}/self-contained
run: dotnet publish ./src/grate/grate.csproj -f net9.0 -r ${{ matrix.arch }} -c release --self-contained -p:SelfContained=true -o ./publish/${{ matrix.arch }}/self-contained
env:
VERSION: ${{ needs.set-version-number.outputs.nuGetVersion }}

Expand Down Expand Up @@ -98,13 +98,13 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x

- name: Publish self-contained ${{ matrix.arch }}
run: dotnet publish ./src/grate/grate.csproj -f net8.0 -r ${{ matrix.arch }} -c release --self-contained -p:SelfContained=true -o ./publish/${{ matrix.arch }}/self-contained
run: dotnet publish ./src/grate/grate.csproj -f net9.0 -r ${{ matrix.arch }} -c release --self-contained -p:SelfContained=true -o ./publish/${{ matrix.arch }}/self-contained
env:
VERSION: ${{ needs.set-version-number.outputs.nuGetVersion }}

Expand All @@ -127,15 +127,15 @@ jobs:
#- osx-x64
steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x

- name: Build Test DLLs ${{ matrix.arch }}
run: |
dotnet restore -r ${{ matrix.arch }} unittests/UnitTests.slnf
dotnet publish -f net8.0 -r ${{ matrix.arch }} -c release --no-restore ./unittests/UnitTests.slnf -o ./integration-tests/${{ matrix.arch }}
dotnet publish -f net9.0 -r ${{ matrix.arch }} -c release --no-restore ./unittests/UnitTests.slnf -o ./integration-tests/${{ matrix.arch }}
env:
VERSION: ${{ needs.set-version-number.outputs.nuGetVersion }}
Expand All @@ -158,15 +158,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x

- name: Build Test DLLs ${{ matrix.arch }}
run: |
dotnet restore -r ${{ matrix.arch }} unittests/UnitTests.slnf
dotnet publish -f net8.0 -r ${{ matrix.arch }} -c release --no-restore ./unittests/UnitTests.slnf -o ./integration-tests/${{ matrix.arch }}
dotnet publish -f net9.0 -r ${{ matrix.arch }} -c release --no-restore ./unittests/UnitTests.slnf -o ./integration-tests/${{ matrix.arch }}
env:
VERSION: ${{ needs.set-version-number.outputs.nuGetVersion }}
Expand Down Expand Up @@ -334,10 +334,10 @@ jobs:
name: integration-tests-linux-x64-${{ needs.set-version-number.outputs.nuGetVersion }}
path: integration-tests/linux-x64

- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x

- name: chmod u+x
run: chmod u+x $GrateExecutablePath
Expand Down Expand Up @@ -445,10 +445,10 @@ jobs:
name: integration-tests-${{ matrix.os.arch }}-${{ needs.set-version-number.outputs.nuGetVersion }}
path: integration-tests/${{ matrix.os.arch }}

- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x

- name: chmod u+x
run: chmod u+x $GrateExecutablePath
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
I'm very happy that you are reading this page! Grate needs all the contributors it can get!
I'll try to jot down a few notes on how to get started developing grate.

## Get .NET 8 (or later)
## Get .NET 9 (or later)

Grate is built with .NET 6/7/8 (and probably soon .NET 9). You can get it [here](https://dotnet.microsoft.com/en-us/download) and start building right away.
Grate is built with .NET 6/7/8/9 (and probably soon .NET 10). You can get it [here](https://dotnet.microsoft.com/en-us/download) and start building right away.

## Get (buy, borrow, rent, or whatever) a computer with an operating system on it

.NET 6+ runs on Windows, macOS or Linux. You choose what you like to use for development.
.NET 8+ runs on Windows, macOS or Linux. You choose what you like to use for development.

## Get Docker

Expand All @@ -27,7 +27,7 @@ git clone https://github.com/erikbra/grate.git

```
> cd grate
> dotnet test --framework net7.0
> dotnet test --framework net9.0
```

## Build a self-contained executable (if you want)
Expand Down
5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@


<PropertyGroup>
<TargetFramework Condition=" '$(TargetFramework)' == '' ">net9.0</TargetFramework>
<NetTargetFrameworks Condition=" '$(NetTargetFrameworks)' == '' ">
net6.0;net7.0;net8.0
net6.0;net7.0;net8.0;net9.0
</NetTargetFrameworks>
</PropertyGroup>

Expand All @@ -35,7 +36,7 @@
grate - sql for the 20s

grate is a no-code, low-fi database migration tool, inspired heavily by RoundhousE. It's written from the ground
up using modern .NET 6/7/8. </Description>
up using modern .NET 6/7/8/9. </Description>
<Copyright>© Erik A. Brandstadmoen. All rights reserved.</Copyright>
<PackageProjectUrl>https://erikbra.github.io/grate/</PackageProjectUrl>
<RepositoryUrl>https://github.com/erikbra/grate</RepositoryUrl>
Expand Down
46 changes: 23 additions & 23 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
<!--
.net sdk
-->
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Npgsql" Version="8.0.3" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="8.0.6" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
<PackageVersion Include="Npgsql" Version="9.0.2" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.0" />
<PackageVersion Include="System.CommandLine.NamingConventionBinder" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<PackageVersion Include="Dapper" Version="2.1.35" />
<PackageVersion Include="MySqlConnector" Version="2.3.7" />
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="3.21.140" />
<PackageVersion Include="MySqlConnector" Version="2.4.0" />
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="3.21.170" />
<!--
Note: the following references are exclusively used in the test projects:
-->
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="xunit" Version="2.8.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
<PackageVersion Include="xunit.runner.utility" Version="2.7.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="XunitXml.TestLogger" Version="3.1.20" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="xunit" Version="2.9.2 " />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="xunit.runner.utility" Version="2.9.2" />
<PackageVersion Include="FluentAssertions" Version="7.0.0" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="XunitXml.TestLogger" Version="5.0.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="Testcontainers" Version="3.9.0" />
<PackageVersion Include="Testcontainers.PostgreSql" Version="3.9.0" />
<PackageVersion Include="Testcontainers.MariaDb" Version="3.9.0" />
<PackageVersion Include="Testcontainers.Oracle" Version="3.9.0" />
<PackageVersion Include="Testcontainers.MsSql" Version="3.9.0" />
<PackageVersion Include="Xunit.DependencyInjection" Version="9.3.0" />
<PackageVersion Include="Testcontainers" Version="4.1.0" />
<PackageVersion Include="Testcontainers.PostgreSql" Version="4.1.0" />
<PackageVersion Include="Testcontainers.MariaDb" Version="4.1.0" />
<PackageVersion Include="Testcontainers.Oracle" Version="4.1.0" />
<PackageVersion Include="Testcontainers.MsSql" Version="4.1.0" />
<PackageVersion Include="Xunit.DependencyInjection" Version="9.7.1" />
<PackageVersion Include="Xunit.DependencyInjection.Logging" Version="9.0.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.4.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.5.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>$(TargetFramework)</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>$(TargetFramework)</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
11 changes: 1 addition & 10 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
{
"sdk": {
"version": "8.0.200",
"version": "9.0.100",
"allowPrerelease": false,
"rollForward": "major"
},
"tools": {
"dotnet": "8.0.200",
"runtimes": {
"aspnetcore": [
"6.0.25",
"7.0.14"
]
}
}
}
2 changes: 1 addition & 1 deletion src/grate/grate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>$(TargetFramework)</TargetFramework>
<DebugType>Embedded</DebugType>
<Nullable>enable</Nullable>

Expand Down
Loading

0 comments on commit 9549a12

Please sign in to comment.