Skip to content

Commit 9265e2a

Browse files
committed
Add and enable full-ci.yml
1 parent 05a8099 commit 9265e2a

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

.github/workflows/full-ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Full Continuous Integration
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
pack:
7+
name: Build (${{ matrix.os }})
8+
runs-on: ${{ matrix.os }}
9+
10+
strategy:
11+
matrix:
12+
os: [ ubuntu-latest, windows-latest, macOS-latest ]
13+
14+
steps:
15+
- name: Get source
16+
uses: actions/checkout@v2
17+
18+
- name: Setup .NET Core 3.1
19+
uses: actions/setup-dotnet@v1
20+
with:
21+
dotnet-version: 3.1.406
22+
23+
- name: Build
24+
run: dotnet build -c Release -v minimal -p:WarningLevel=3
25+
26+
- name: Test
27+
run: dotnet test -c Release --no-build
28+
shell: bash # defaults disagree on how to quote the filter string
29+
30+
- name: Pack
31+
run: dotnet pack -c Release --no-build -o artifacts -p:NoWarn=NU5105
32+
33+
- name: Upload
34+
uses: actions/upload-artifact@v2
35+
with:
36+
name: NuGet Package Files (${{ matrix.os }})
37+
path: artifacts
38+
39+
deployToMyGet:
40+
name: Deploy to MyGet
41+
runs-on: ubuntu-latest
42+
43+
needs: pack
44+
if: github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')
45+
46+
steps:
47+
- name: Setup .NET Core 3.1
48+
uses: actions/setup-dotnet@v1
49+
with:
50+
dotnet-version: 3.1.406
51+
52+
- name: Download Package Files
53+
uses: actions/download-artifact@v2
54+
with:
55+
name: NuGet Package Files (ubuntu-latest)
56+
path: artifacts
57+
58+
- name: Publish Package Files to MyGet
59+
run: dotnet nuget push artifacts/*.nupkg -s https://www.myget.org/F/nettopologysuite/api/v3/index.json -k $MYGET_API_KEY
60+
shell: bash
61+
env:
62+
MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}
63+
64+
deployToNuGet:
65+
name: Deploy to NuGet
66+
runs-on: ubuntu-latest
67+
68+
needs: pack
69+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
70+
71+
steps:
72+
- name: Setup .NET Core 3.1
73+
uses: actions/setup-dotnet@v1
74+
with:
75+
dotnet-version: 3.1.406
76+
77+
- name: Download Package Files
78+
uses: actions/download-artifact@v2
79+
with:
80+
name: NuGet Package Files (ubuntu-latest)
81+
path: artifacts
82+
83+
- name: Publish Package Files to NuGet
84+
run: dotnet nuget push artifacts/*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY
85+
shell: bash
86+
env:
87+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
88+

src/Directory.Build.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@
3030
<NtsBuildMetadata Condition=" '$(NtsBuildMetadata)' == '' ">ci.appveyor.$(APPVEYOR_BUILD_NUMBER)</NtsBuildMetadata>
3131
</PropertyGroup>
3232

33+
<!-- GitHub Actions -->
34+
<PropertyGroup Condition=" '$(GITHUB_ACTIONS)' == 'True' ">
35+
<Deterministic>true</Deterministic>
36+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
37+
<NtsBuildMetadata Condition=" '$(NtsBuildMetadata)' == '' ">ci.github.$(GITHUB_RUN_ID)</NtsBuildMetadata>
38+
39+
<NtsOfficialRelease Condition=" '$(GITHUB_REF)' == 'refs/heads/master' And '$(GITHUB_EVENT_NAME)' == 'push' ">true</NtsOfficialRelease>
40+
</PropertyGroup>
41+
42+
3343
<!-- Fallback for local builds and CI environments we don't recognize -->
3444
<PropertyGroup>
3545
<NtsBuildMetadata Condition=" '$(NtsBuildMetadata)' == '' ">local</NtsBuildMetadata>

0 commit comments

Comments
 (0)