Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to .NET 6 #717

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/dotnet/.devcontainer/base.Dockerfile
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/main/containers/dotnet/.devcontainer/base.Dockerfile

# [Choice] .NET version: 5.0, 3.1, 2.1
ARG VARIANT=3.1
# [Choice] .NET version: 6.0, 5.0, 3.1, 2.1
ARG VARIANT=6.0
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}
22 changes: 11 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: 6.0.x
- name: Test
run: dotnet test --verbosity normal

Expand All @@ -40,7 +40,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: 6.0.x
- name: Publish
run: dotnet publish src/BaGet --configuration Release --output artifacts
- name: Upload
Expand All @@ -59,7 +59,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: 6.0.x
- name: Pack
run: dotnet pack --configuration Release --output artifacts
- name: Push
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY /src .
RUN dotnet restore BaGet
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<NoWarn>IDE0007</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Moq" Version="4.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion samples/BaGetWebApplication/BaGetWebApplication.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/BaGet.Aliyun/BaGet.Aliyun.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<PropertyGroup>
<PackageTags>NuGet;Alibaba;Cloud</PackageTags>
<Description>The libraries to host BaGet on Alibaba Cloud (Aliyun).</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.9.1" />
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 3 additions & 4 deletions src/BaGet.Aws/BaGet.Aws.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>

<TargetFramework>net6.0</TargetFramework>
<PackageTags>NuGet;Amazon;Cloud</PackageTags>
<Description>The libraries to host BaGet on AWS.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.S3" Version="3.3.110.20" />
<PackageReference Include="AWSSDK.SecurityToken" Version="3.3.104.27" />
<PackageReference Include="AWSSDK.S3" Version="3.7.7.22" />
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.1.115" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="$(MicrosoftExtensionsPackageVersion)" />
</ItemGroup>

Expand Down
3 changes: 1 addition & 2 deletions src/BaGet.Azure/BaGet.Azure.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>

<TargetFramework>net6.0</TargetFramework>
<PackageTags>NuGet;Azure;Cloud</PackageTags>
<Description>The libraries to host BaGet on Azure.</Description>
</PropertyGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/BaGet.Core/BaGet.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>

<TargetFramework>net6.0</TargetFramework>
<PackageTags>NuGet</PackageTags>
<Description>The core libraries that power BaGet.</Description>
</PropertyGroup>
Expand All @@ -13,7 +12,7 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageReference Include="NuGet.Protocol" Version="$(NuGetPackageVersion)" />
<PackageReference Include="System.Reflection.Metadata" Version="1.6.0" />
<PackageReference Include="System.Reflection.Metadata" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/BaGet.Database.MySql/BaGet.Database.MySql.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFramework>net6.0</TargetFramework>

<PackageTags>NuGet</PackageTags>
<Description>The libraries to host BaGet on MySQL.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
73 changes: 47 additions & 26 deletions src/BaGet.Database.MySql/Migrations/20181212113156_Initial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,50 @@ public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");

migrationBuilder.CreateTable(
name: "Packages",
columns: table => new
{
Key = table.Column<int>(nullable: false)
Key = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Id = table.Column<string>(maxLength: 128, nullable: false),
Authors = table.Column<string>(maxLength: 4000, nullable: true),
Description = table.Column<string>(maxLength: 4000, nullable: true),
Downloads = table.Column<long>(nullable: false),
HasReadme = table.Column<bool>(nullable: false),
Language = table.Column<string>(maxLength: 20, nullable: true),
Listed = table.Column<bool>(nullable: false),
MinClientVersion = table.Column<string>(maxLength: 44, nullable: true),
Published = table.Column<DateTime>(nullable: false),
RequireLicenseAcceptance = table.Column<bool>(nullable: false),
Summary = table.Column<string>(maxLength: 4000, nullable: true),
Title = table.Column<string>(maxLength: 256, nullable: true),
IconUrl = table.Column<string>(maxLength: 4000, nullable: true),
LicenseUrl = table.Column<string>(maxLength: 4000, nullable: true),
ProjectUrl = table.Column<string>(maxLength: 4000, nullable: true),
RepositoryUrl = table.Column<string>(maxLength: 4000, nullable: true),
RepositoryType = table.Column<string>(maxLength: 100, nullable: true),
Tags = table.Column<string>(maxLength: 4000, nullable: true),
RowVersion = table.Column<DateTime>(rowVersion: true, nullable: true),
Version = table.Column<string>(maxLength: 64, nullable: false)
Id = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Authors = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Downloads = table.Column<long>(type: "bigint", nullable: false),
HasReadme = table.Column<bool>(type: "tinyint(1)", nullable: false),
Language = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Listed = table.Column<bool>(type: "tinyint(1)", nullable: false),
MinClientVersion = table.Column<string>(type: "varchar(44)", maxLength: 44, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Published = table.Column<DateTime>(type: "datetime(6)", nullable: false),
RequireLicenseAcceptance = table.Column<bool>(type: "tinyint(1)", nullable: false),
Summary = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Title = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IconUrl = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
LicenseUrl = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ProjectUrl = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RepositoryUrl = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RepositoryType = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Tags = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RowVersion = table.Column<DateTime>(type: "timestamp(6)", rowVersion: true, nullable: true)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
Version = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
},
constraints: table =>
{
Expand All @@ -44,12 +62,15 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "PackageDependencies",
columns: table => new
{
Key = table.Column<int>(nullable: false)
Key = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Id = table.Column<string>(maxLength: 128, nullable: true),
VersionRange = table.Column<string>(maxLength: 256, nullable: true),
TargetFramework = table.Column<string>(maxLength: 256, nullable: true),
PackageKey = table.Column<int>(nullable: false)
Id = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
VersionRange = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TargetFramework = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PackageKey = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,17 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "FK_PackageDependencies_Packages_PackageKey",
table: "PackageDependencies");

migrationBuilder.AlterColumn<DateTime>(
name: "RowVersion",
table: "Packages",
rowVersion: true,
nullable: true,
oldClrType: typeof(DateTime),
oldNullable: true);

migrationBuilder.AddColumn<bool>(
name: "IsPrerelease",
table: "Packages",
type: "tinyint(1)",
nullable: false,
defaultValue: false);

migrationBuilder.AddColumn<int>(
name: "SemVerLevel",
table: "Packages",
type: "int",
nullable: false,
defaultValue: 0);

Expand All @@ -42,11 +36,13 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "PackageTypes",
columns: table => new
{
Key = table.Column<int>(nullable: false)
Key = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(maxLength: 512, nullable: true),
Version = table.Column<string>(maxLength: 64, nullable: true),
PackageKey = table.Column<int>(nullable: false)
Name = table.Column<string>(type: "varchar(255)", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Version = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PackageKey = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
Expand All @@ -63,10 +59,11 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "TargetFrameworks",
columns: table => new
{
Key = table.Column<int>(nullable: false)
Key = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Moniker = table.Column<string>(maxLength: 256, nullable: true),
PackageKey = table.Column<int>(nullable: false)
Moniker = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PackageKey = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
Expand Down Expand Up @@ -137,14 +134,6 @@ protected override void Down(MigrationBuilder migrationBuilder)
name: "SemVerLevel",
table: "Packages");

migrationBuilder.AlterColumn<DateTime>(
name: "RowVersion",
table: "Packages",
nullable: true,
oldClrType: typeof(DateTime),
oldRowVersion: true,
oldNullable: true);

migrationBuilder.AlterColumn<int>(
name: "PackageKey",
table: "PackageDependencies",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,10 @@ public partial class AddOriginalVersionStringColumn : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "RowVersion",
table: "Packages",
rowVersion: true,
nullable: true,
oldClrType: typeof(DateTime),
oldNullable: true);

migrationBuilder.AddColumn<string>(
name: "OriginalVersion",
table: "Packages",
type: "varchar(64)",
maxLength: 64,
nullable: true);
}
Expand All @@ -27,14 +20,6 @@ protected override void Down(MigrationBuilder migrationBuilder)
migrationBuilder.DropColumn(
name: "OriginalVersion",
table: "Packages");

migrationBuilder.AlterColumn<DateTime>(
name: "RowVersion",
table: "Packages",
nullable: true,
oldClrType: typeof(DateTime),
oldRowVersion: true,
oldNullable: true);
}
}
}
Loading