build: 项目升级到 NETCore 3.1 版本

This commit is contained in:
Argo Window10 2019-12-11 23:44:12 +08:00 committed by Argo Zhang
parent c9c591a582
commit 001f5921a5
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
14 changed files with 44 additions and 50 deletions

View File

@ -14,6 +14,6 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.0.100
dotnet-version: 3.1.100
- name: Build with dotnet
run: dotnet build src/admin/Bootstrap.Admin/ --configuration Release

View File

@ -36,7 +36,7 @@ test_script:
- ps: >-
.\appveyor.test.ps1
artifacts:
- path: src\admin\Bootstrap.Admin\bin\release\netcoreapp3.0\publish\
- path: src\admin\Bootstrap.Admin\bin\release\netcoreapp3.1\publish\
name: BootstrapAdmin
type: WebDeployPackage
deploy:

View File

@ -3,8 +3,8 @@
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<PackageProjectUrl>https://gitee.com/LongbowGroup/$(MsBuildProjectName)</PackageProjectUrl>
<RepositoryUrl>https://gitee.com/LongbowGroup/$(MsBuildProjectName).git</RepositoryUrl>
<PackageProjectUrl>https://gitee.com/LongbowEnterprise/BootstrapAdmin</PackageProjectUrl>
<RepositoryUrl>https://gitee.com/LongbowEnterprise/BootstrapAdmin.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Nullable>enable</Nullable>
<DocumentationFile>$(MSBuildProjectName).xml</DocumentationFile>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsWebProject>true</IsWebProject>
</PropertyGroup>
@ -10,8 +10,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Longbow.Logging" Version="3.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.0.0" />
<PackageReference Include="Longbow.Logging" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.1.0" />
<PackageReference Include="Sentry.AspNetCore" Version="2.0.0-beta6" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
</ItemGroup>

View File

@ -1,11 +1,11 @@
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM microsoft/dotnet:3.0-aspnetcore-runtime-nanoserver-1903 AS base
FROM microsoft/dotnet:3.1-aspnetcore-runtime-nanoserver-1903 AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/dotnet:3.0-sdk-nanoserver-1903 AS build
FROM microsoft/dotnet:3.1-sdk-nanoserver-1903 AS build
WORKDIR /src
COPY . .

View File

@ -1,11 +1,11 @@
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0 AS base
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src
COPY . .

View File

@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security" Version="3.0.1" />
<PackageReference Include="MongoDB.Driver" Version="2.9.3" />
<PackageReference Include="Bootstrap.Security" Version="3.1.0" />
<PackageReference Include="MongoDB.Driver" Version="2.10.0" />
</ItemGroup>
<ItemGroup>

View File

@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="3.0.1" />
<PackageReference Include="Bootstrap.Security.Mvc" Version="3.0.3" />
<PackageReference Include="Longbow" Version="3.0.1" />
<PackageReference Include="Longbow.Cache" Version="3.0.3" />
<PackageReference Include="Longbow.Data" Version="3.0.1" />
<PackageReference Include="Longbow.GiteeAuth" Version="3.0.1" />
<PackageReference Include="Longbow.GitHubAuth" Version="3.0.1" />
<PackageReference Include="Longbow.OAuth" Version="3.0.2" />
<PackageReference Include="Bootstrap.Security.DataAccess" Version="3.1.0" />
<PackageReference Include="Bootstrap.Security.Mvc" Version="3.1.0" />
<PackageReference Include="Longbow" Version="3.1.0" />
<PackageReference Include="Longbow.Cache" Version="3.1.0" />
<PackageReference Include="Longbow.Data" Version="3.1.0" />
<PackageReference Include="Longbow.GiteeAuth" Version="3.1.0" />
<PackageReference Include="Longbow.GitHubAuth" Version="3.1.0" />
<PackageReference Include="Longbow.OAuth" Version="3.1.0" />
<PackageReference Include="Longbow.PetaPoco" Version="1.0.2" />
<PackageReference Include="Longbow.Security.Cryptography" Version="1.3.0" />
<PackageReference Include="Longbow.Tasks" Version="3.0.3" />
<PackageReference Include="Longbow.Web" Version="3.0.1" />
<PackageReference Include="Longbow.WeChatAuth" Version="3.0.1" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.0.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.7.0" />
<PackageReference Include="Longbow.Tasks" Version="3.1.0" />
<PackageReference Include="Longbow.Web" Version="3.1.0" />
<PackageReference Include="Longbow.WeChatAuth" Version="3.1.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.0" />
<PackageReference Include="PetaPoco.Extensions" Version="3.0.1" />
</ItemGroup>

View File

@ -50,7 +50,6 @@ namespace Bootstrap.DataAccess
};
}
#if NETCOREAPP3_0
private static T? ToObject<T>(this System.Text.Json.JsonElement element) where T : OAuthUser
{
var user = new OAuthUser();
@ -69,7 +68,6 @@ namespace Bootstrap.DataAccess
ret = property.Value.ToString();
return ret;
}
#endif
/// <summary>
/// 插入 Gitee 授权用户到数据库中

View File

@ -4,9 +4,7 @@ using Longbow.WeChatAuth;
using Microsoft.AspNetCore.Authentication.OAuth;
using System;
using System.Linq;
#if NETCOREAPP3_0
using System.Text.Json;
#endif
namespace Bootstrap.DataAccess
{
@ -55,7 +53,6 @@ namespace Bootstrap.DataAccess
};
}
#if NETCOREAPP3_0
private static T? ToObject<T>(this JsonElement element) where T : WeChatUser
{
var user = new WeChatUser();
@ -80,6 +77,5 @@ namespace Bootstrap.DataAccess
ret = property.Value.ToString();
return ret;
}
#endif
}
}

View File

@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.9.3" />
<PackageReference Include="MongoDB.Driver" Version="2.10.0" />
</ItemGroup>
<ItemGroup>

View File

@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="3.0.1" />
<PackageReference Include="Bootstrap.Security.Mvc" Version="3.0.3" />
<PackageReference Include="Longbow" Version="3.0.1" />
<PackageReference Include="Longbow.Cache" Version="3.0.3" />
<PackageReference Include="Longbow.Data" Version="3.0.1" />
<PackageReference Include="Longbow.Web" Version="3.0.1" />
<PackageReference Include="System.Data.SqlClient" Version="4.7.0" />
<PackageReference Include="Bootstrap.Security.DataAccess" Version="3.1.0" />
<PackageReference Include="Bootstrap.Security.Mvc" Version="3.1.0" />
<PackageReference Include="Longbow" Version="3.1.0" />
<PackageReference Include="Longbow.Cache" Version="3.1.0" />
<PackageReference Include="Longbow.Data" Version="3.1.0" />
<PackageReference Include="Longbow.Web" Version="3.1.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.0" />
</ItemGroup>
</Project>

View File

@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsWebProject>true</IsWebProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Longbow.Logging" Version="3.0.3" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.0.0" />
<PackageReference Include="Longbow.Logging" Version="3.1.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.0" />
</ItemGroup>
<ItemGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
<DebugType>full</DebugType>
</PropertyGroup>
@ -15,8 +15,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.0.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="MySql.Data" Version="8.0.18" />
<PackageReference Include="Npgsql" Version="4.1.2" />