-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (65 loc) · 2.76 KB
/
nuget-publish.yaml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Tested and Published on NuGet
on:
push:
branches: [ master ]
jobs:
publish:
runs-on: ubuntu-22.04
steps:
- name: Checkout OpenActive.NET
uses: actions/checkout@v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Get current version
uses: dotnet/nbgv@master
id: nbgv
- name: Setup .NET Core 3.1.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Install dependencies
run: dotnet restore
- name: Test
run: dotnet test ./OpenActive.NET.Test/OpenActive.NET.Test.csproj --configuration Release --no-restore --verbosity normal
- name: Build
run: dotnet build ./OpenActive.NET/OpenActive.NET.csproj --configuration Release --no-restore
- name: Pack
run: dotnet pack ./OpenActive.NET/OpenActive.NET.csproj --configuration Release --include-source --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
- name: Push to Nuget
if: "! contains(toJSON(github.event.commits.*.message), '[no-release]')"
run: dotnet nuget push "./OpenActive.NET/**/*.nupkg" -k ${{secrets.NUGET_API_KEY}} --skip-duplicate -s https://api.nuget.org/v3/index.json
- name: Create Release
if: "! contains(toJSON(github.event.commits.*.message), '[no-release]')"
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.nbgv.outputs.SimpleVersion }}
release_name: Release ${{ steps.nbgv.outputs.SimpleVersion }}
body: |
This release contains minor amendments based on updates to the [OpenActive Vocabulary](https://openactive.io/ns/) (codified by the [Data Models](https://github.com/openactive/data-models)), [Test Interface](https://openactive.io/test-interface/) and/or [Beta Namespace](https://openactive.io/ns-beta/).
Published to [Nuget](https://www.nuget.org/packages/OpenActive.NET/${{ steps.nbgv.outputs.SimpleVersion }}).
draft: false
prerelease: false
sleep:
needs: publish
runs-on: ubuntu-latest
steps:
- name: Sleep for 10 minutes to wait for NuGet to update
uses: whatnick/[email protected]
with:
time: '10m'
dispatch:
needs: sleep
strategy:
matrix:
repo: ['OpenActive.DatasetSite.NET']
runs-on: ubuntu-latest
steps:
- name: Trigger tooling update
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
repository: openactive/${{ matrix.repo }}
event-type: OpenActive.NET-update