Skip to content

Commit fc958b6

Browse files
committed
Support multi TargetFrameworks: net6.0, net5.0, netstandard2.0; update package tags
1 parent f88ac56 commit fc958b6

File tree

14 files changed

+352
-60
lines changed

14 files changed

+352
-60
lines changed
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ pool:
3131
vmImage: $(imageName)
3232

3333
steps:
34+
- task: UseDotNet@2
35+
displayName: "Use .NET Core sdk 6.x"
36+
inputs:
37+
version: 6.x
38+
includePreviewVersions: true
39+
3440
- task: UseDotNet@2
3541
displayName: "Use .NET Core sdk 5.x"
3642
inputs:
@@ -44,16 +50,19 @@ steps:
4450
- script: dotnet --info
4551
displayName: "dotnet info"
4652

47-
- script: dotnet build --configuration $(buildConfiguration)
53+
- script: dotnet restore --verbosity normal
54+
displayName: Install dependencies
55+
56+
- script: dotnet build --configuration $(buildConfiguration) --verbosity normal
4857
displayName: "dotnet build $(buildConfiguration)"
4958

5059
- script: dotnet test --configuration $(buildConfiguration) --no-build --verbosity normal
5160
displayName: "dotnet test $(buildConfiguration)"
5261

53-
- script: dotnet pack ./Testing.Dynamic.Json/Testing.Dynamic.Json.csproj -c $(buildConfiguration) -o ./nuget/ --no-build
62+
- script: dotnet pack -c $(buildConfiguration) -o ./artifacts/packages/ --no-build --verbosity normal
5463
displayName: "dotnet pack $(buildConfiguration)"
5564
condition: and(succeeded(), eq(variables.imageName, 'windows-latest'))
5665

57-
- script: dotnet nuget push .\nuget\*.nupkg -s https://www.myget.org/F/netlah/api/v2/package -k $(secrets.MYGET)
66+
- script: dotnet nuget push .\artifacts\packages\*.nupkg -s https://www.myget.org/F/netlah/api/v2/package -k $(secrets.MYGET)
5867
displayName: "dotnet nuget push MyGet"
5968
condition: and(succeeded(), eq(variables.imageName, 'windows-latest'), or(eq(variables['build.sourceBranch'], 'refs/heads/main'), startsWith(variables['build.sourceBranch'], 'refs/tags/')))

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"minver-cli": {
6-
"version": "2.3.1",
6+
"version": "2.5.0",
77
"commands": [
88
"minver"
99
]

.github/workflows/dotnet-core.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: .NET Core
33
on:
44
push:
55
branches: [main]
6+
tags: ["*.*.*"]
67
pull_request:
78
branches: [main]
89

@@ -16,17 +17,31 @@ jobs:
1617
runs-on: ${{ matrix.runs-on }}
1718
steps:
1819
- uses: actions/checkout@v2
19-
- name: Setup .NET Core 3.1.x
20+
with:
21+
fetch-depth: 0
22+
- name: Setup .NET Core 6.0.x
2023
uses: actions/setup-dotnet@v1
2124
with:
22-
dotnet-version: 3.1.x
25+
dotnet-version: "6.0.x"
26+
include-prerelease: true
2327
- name: Setup .NET Core 5.0.x
2428
uses: actions/setup-dotnet@v1
2529
with:
2630
dotnet-version: 5.0.x
31+
- name: Setup .NET Core 3.1.x
32+
uses: actions/setup-dotnet@v1
33+
with:
34+
dotnet-version: 3.1.x
35+
- name: dotnet info
36+
run: dotnet --info
2737
- name: Install dependencies
28-
run: dotnet restore
38+
run: dotnet restore --verbosity normal
2939
- name: Build
30-
run: dotnet build --configuration Release --no-restore
40+
run: dotnet build --configuration Release --no-restore --verbosity normal
3141
- name: Test
32-
run: dotnet test --configuration Release --no-build --verbosity normal
42+
run: dotnet test -c Release --no-build --verbosity normal
43+
- name: Pack
44+
run: dotnet pack -c Release -o ./artifacts/packages/ --no-build --verbosity normal
45+
- if: ${{ success() && runner.os == 'Windows' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }}
46+
name: Publish Nuget to GitHub registry
47+
run: dotnet nuget push .\artifacts\packages\*.nupkg -s https://nuget.pkg.github.com/NetLah/index.json -k ${{ secrets.PUSH_GITHUB_REGISTRY_TOKEN }}

Directory.Build.props

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<PackageTags>NetLah;.NetCore;ASP.NETCore</PackageTags>
5+
<Authors>ThoHo;NetLah</Authors>
6+
<Company>NetLah</Company>
7+
<Copyright>NetLah</Copyright>
8+
<Product>NetLah .NET</Product>
9+
10+
<!--PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance-->
11+
12+
<!--PackageIcon>icon.png</PackageIcon-->
13+
<PackageProjectUrl>https://github.com/NetLah/Dynamic.Json</PackageProjectUrl>
14+
<PackageReleaseNotes>https://github.com/NetLah/Dynamic.Json/releases</PackageReleaseNotes>
15+
16+
<!-- Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
17+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
18+
19+
<!-- Embed source files that are not tracked by the source control manager in the PDB -->
20+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
21+
22+
<LangVersion>9.0</LangVersion>
23+
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
24+
<GenerateDocumentationFile>false</GenerateDocumentationFile>
25+
</PropertyGroup>
26+
27+
<PropertyGroup Condition=" '$(TEAMCITY_VERSION)' != '' OR '$(CI)' == 'true' OR '$(TF_BUILD)' == 'true' OR '$(GITHUB_ACTIONS)' == 'true'">
28+
<!-- Recommended: Embed symbols containing Source Link in the main file (exe/dll) -->
29+
<DebugType>embedded</DebugType>
30+
31+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
32+
<ContinuousIntegrationBuild>True</ContinuousIntegrationBuild>
33+
</PropertyGroup>
34+
35+
<ItemGroup Condition=" '$(TEAMCITY_VERSION)' != '' OR '$(CI)' == 'true' OR '$(TF_BUILD)' == 'true' OR '$(GITHUB_ACTIONS)' == 'true'">
36+
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
37+
</ItemGroup>
38+
39+
</Project>

0 commit comments

Comments
 (0)