Skip to content

Commit 118d232

Browse files
Merge branch 'main' into feature/move-to-support-net-standard20
2 parents 43ee7dc + eba1551 commit 118d232

5 files changed

Lines changed: 72 additions & 9 deletions

File tree

.github/workflows/ci-build.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@ on:
44
push:
55
pull_request:
66
branches: [ main ]
7+
release:
8+
types:
9+
- published
10+
11+
env:
12+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
13+
DOTNET_CLI_TELEMETRY_OPTOUT: true
14+
15+
# Project name to pack and publish
16+
PROJECT_NAME: GeoJSON.Text
717

818
jobs:
9-
Build:
19+
build:
1020

1121
name: 'Build and Test'
1222
runs-on: windows-latest
@@ -27,16 +37,19 @@ jobs:
2737
5.0.x
2838
6.0.x
2939
- name: Install dependencies
30-
run: dotnet restore
40+
run: dotnet restore src/${{ env.PROJECT_NAME }}.sln
3141
- name: Build solution
32-
run: dotnet build -c Release --no-restore /p:Version=1.2.3.4
42+
run: dotnet build src/${{ env.PROJECT_NAME }}.sln -c Release --no-restore
3343
- name: Test
34-
run: dotnet test -c Release --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=../coverage/
44+
run: dotnet test src/${{ env.PROJECT_NAME }}.sln -c Release --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=../coverage/
3545
- uses: codecov/codecov-action@v2
3646
if: ${{ github.event_name == 'push' }}
3747
with:
3848
token: ${{ secrets.CODECOV_TOKEN }}
3949
directory: src/coverage
4050
flags: unittests
41-
42-
51+
- name: Upload Artifact
52+
uses: actions/upload-artifact@v2
53+
with:
54+
name: nupkg
55+
path: src/${{ env.PROJECT_NAME }}/bin/Release/*.nupkg

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: 'Build and Test'
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
env:
9+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
10+
DOTNET_CLI_TELEMETRY_OPTOUT: true
11+
12+
# Project name to pack and publish
13+
PROJECT_NAME: GeoJSON.Text
14+
15+
# Official NuGet Feed settings
16+
NUGET_FEED: https://api.nuget.org/v3/index.json
17+
NUGET_KEY: ${{ secrets.NUGET_KEY }}
18+
19+
jobs:
20+
deploy:
21+
name: 'Deploy to Nuget'
22+
if: github.event_name == 'release'
23+
needs: build
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Setup .NET Core
29+
uses: actions/setup-dotnet@v1
30+
with:
31+
dotnet-version: |
32+
3.1.x
33+
5.0.x
34+
6.0.x
35+
- name: Create Release NuGet package
36+
run: |
37+
arrTag=(${GITHUB_REF//\// })
38+
VERSION="${arrTag[2]}"
39+
VERSION="${VERSION//v}"
40+
dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg src/$PROJECT_NAME/$PROJECT_NAME.csproj
41+
- name: Push to Nuget
42+
run: dotnet nuget push nuget/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_KEY}} --skip-duplicate

key.snk

596 Bytes
Binary file not shown.

src/GeoJSON.Text.Test.Benchmark/GeoJSON.Text.Test.Benchmark.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>netcoreapp3.1;net5;net6</TargetFrameworks>
5+
<TargetFrameworks>netstandard2.0;net5;net6</TargetFrameworks>
66
<ImplicitUsings>disable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<SignAssembly>False</SignAssembly>
9+
<LangVersion>Latest</LangVersion>
910
</PropertyGroup>
1011

1112
<ItemGroup>

src/GeoJSON.Text/GeoJSON.Text.csproj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Description>.Net types for the GeoJSON RFC to be used with System.Text.Json</Description>
77
<Authors>Matt Hunt</Authors>
88
<Company>GeoJSON.Text</Company>
9-
<Copyright>Copyright © Matt Hunt, Xavier Fischer and Contributors, 2014 - 2021</Copyright>
9+
<Copyright>Copyright © Matt Hunt and Contributors, 2014 - 2021</Copyright>
1010
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1111
<Version>0.1.0</Version>
1212
<PackageProjectUrl>https://github.com/GeoJSON-Net/GeoJSON.Text</PackageProjectUrl>
@@ -20,9 +20,16 @@
2020
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2121
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2222
<PublishRepositoryUrl>true</PublishRepositoryUrl>
23-
23+
<SignAssembly>true</SignAssembly>
24+
<AssemblyOriginatorKeyFile>../key.snk</AssemblyOriginatorKeyFile>
25+
<DelaySign>false</DelaySign>
26+
2427
</PropertyGroup>
2528

29+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
30+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
31+
</PropertyGroup>
32+
2633
<ItemGroup>
2734
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
2835
<PackageReference Include="System.Text.Json" Version="6.0.1" />

0 commit comments

Comments
 (0)