-
-
Notifications
You must be signed in to change notification settings - Fork 8
51 lines (43 loc) · 1.3 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: ci
on:
push:
paths-ignore:
- 'README.md'
- 'readme.md'
pull_request:
jobs:
CheckSkipCI:
runs-on: ubuntu-latest
if: |
!contains(github.event.head_commit.message, '[skip ci]') &&
!contains(github.event.pull_request.title, '[skip ci]') &&
!contains(github.event.head_commit.message, '[skip-ci]') &&
!contains(github.event.pull_request.title, '[skip-ci]')
steps:
- run: exit 0
build:
runs-on: windows-latest
needs: [CheckSkipCI]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Install .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Version
uses: aarnott/[email protected]
with:
setAllVars: true
- name: Pack
run: dotnet pack src --configuration Release --output build/packages
- name: Publish to NuGet
if: github.event_name == 'push'
run: |
if ( "${{github.ref}}" -match "^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$" ) {
dotnet nuget push build\packages\**\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_TOKEN}}
} else {
echo "publish is only enabled by tagging with a release tag"
}