Skip to content

Commit 119c30e

Browse files
committed
fix: CI and bump dependencies
1 parent 9797e10 commit 119c30e

File tree

11 files changed

+225
-55
lines changed

11 files changed

+225
-55
lines changed

.github/workflows/OpenActive.FakeDatabase.NET.Tests.yml

-24
This file was deleted.

.github/workflows/OpenActive.Server.NET.Tests.yml

-24
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Update Dependencies
2+
3+
on:
4+
workflow_dispatch:
5+
repository_dispatch:
6+
types: [OpenActive.NET-update,OpenActive.DatasetSite.NET-update]
7+
8+
jobs:
9+
generate:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout OpenActive.Server.NET
14+
uses: actions/checkout@v2
15+
with:
16+
ref: master
17+
18+
- name: Setup .NET 6.0.x
19+
uses: actions/setup-dotnet@v2
20+
with:
21+
dotnet-version: 6.0.x
22+
23+
- name: Update OpenActive.NET to latest version in OpenActive.Server.NET
24+
run: dotnet add package OpenActive.NET
25+
working-directory: ./OpenActive.Server.NET/
26+
27+
- name: Update OpenActive.DatasetSite.NET to latest version in OpenActive.Server.NET
28+
run: dotnet add package OpenActive.DatasetSite.NET
29+
working-directory: ./OpenActive.Server.NET/
30+
31+
- name: Update OpenActive.NET to latest version in OpenActive.FakeDatabase.NET
32+
run: dotnet add package OpenActive.NET
33+
working-directory: ./Fakes/OpenActive.FakeDatabase.NET/
34+
35+
- name: Update OpenActive.NET to latest version in BookingSystem.AspNetFramework
36+
run: dotnet add package OpenActive.NET
37+
working-directory: ./Examples/BookingSystem.AspNetFramework/
38+
39+
- name: Update OpenActive.DatasetSite.NET to latest version in BookingSystem.AspNetFramework
40+
run: dotnet add package OpenActive.DatasetSite.NET
41+
working-directory: ./Examples/BookingSystem.AspNetFramework/
42+
43+
- name: git stash if material changes have not been made
44+
# When considering whether it's worth making a PR, ignore the following:
45+
# - Any updates to the package.json or package-lock.json files in OpenActive.DatasetSite.NET.Generator (not worth creating a PR JUST for these if the template itself has not been updated)
46+
# git stashing if no material changes allows the next step to close the PR if one is already open
47+
run: if [ "$(git diff --numstat | grep -vc '^.*package\.json\|.*package-lock\.json$')" -eq "0" ]; then git stash; else echo "Material changes found"; fi
48+
working-directory: ./
49+
50+
- name: Create Pull Request
51+
id: cpr
52+
uses: peter-evans/create-pull-request@v3
53+
with:
54+
path: .
55+
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
56+
commit-message: Update dependencies
57+
committer: openactive-bot <openactive-bot@users.noreply.github.com>
58+
author: openactive-bot <openactive-bot@users.noreply.github.com>
59+
signoff: false
60+
branch: ci/update-data-models
61+
delete-branch: true
62+
title: 'Update dependencies'
63+
body: |
64+
Update to use latest version of [OpenActive.NET](https://github.com/openactive/OpenActive.NET/) and [OpenActive.DatasetSite.NET](https://github.com/openactive/OpenActive.DatasetSite.NET/)
65+
labels: |
66+
automated pr
67+
team-reviewers: |
68+
owners
69+
maintainers
70+
draft: false
71+
72+
- name: Check outputs
73+
run: |
74+
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
75+
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"

.github/workflows/openactive-test-suite.yml

+124-1
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,55 @@ on:
44
branches: [ master ]
55
pull_request:
66
branches: [ master ]
7+
78
jobs:
9+
test-server:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
16+
- name: Setup .NET Core 3.1.419
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: 3.1.419
20+
- name: Build OpenActive.Server.NET.Tests and dependencies
21+
run: dotnet build ./OpenActive.Server.NET.Tests/OpenActive.Server.NET.Tests.csproj --configuration Release
22+
- name: Run OpenActive.Server.NET.Tests
23+
run: dotnet test ./OpenActive.Server.NET.Tests/OpenActive.Server.NET.Tests.csproj --configuration Release --no-build --verbosity normal
24+
25+
test-fake-database:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v2
30+
with:
31+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
32+
- name: Setup .NET Core 3.1.419
33+
uses: actions/setup-dotnet@v1
34+
with:
35+
dotnet-version: 3.1.419
36+
- name: Build OpenActive.FakeDatabase.NET.Tests
37+
run: dotnet build ./Fakes/OpenActive.FakeDatabase.NET.Tests/OpenActive.FakeDatabase.NET.Tests.csproj --configuration Release
38+
- name: Run OpenActive.FakeDatabase.NET.Tests
39+
run: dotnet test ./Fakes/OpenActive.FakeDatabase.NET.Tests/OpenActive.FakeDatabase.NET.Tests.csproj --configuration Release --no-build --verbosity normal
40+
841
core:
42+
needs:
43+
- test-server
44+
- test-fake-database
945
runs-on: ubuntu-latest
1046
strategy:
1147
fail-fast: false
1248
matrix:
1349
mode: ['random', 'controlled']
14-
profile: ['all-features', 'single-seller', 'no-payment-reconciliation', 'no-auth']
50+
profile: ['all-features', 'single-seller', 'no-payment-reconciliation', 'no-auth', 'no-tax-calculation', 'prepayment-always-required']
1551
steps:
1652
- name: Checkout OpenActive.Server.NET
1753
uses: actions/checkout@v2
1854
with:
55+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
1956
path: server
2057
- name: Use matching coverage/* branch ${{ github.head_ref }} in OpenActive Test Suite
2158
if: ${{ startsWith(github.head_ref, 'coverage/') }}
@@ -78,7 +115,11 @@ jobs:
78115
container_name: '$web'
79116
connection_string: ${{ secrets.CONFORMANCE_CERTIFICATE_BLOB_STORAGE_CONNECTION_STRING }}
80117
sync: false
118+
81119
framework:
120+
needs:
121+
- test-server
122+
- test-fake-database
82123
runs-on: windows-2019
83124
strategy:
84125
fail-fast: false
@@ -89,7 +130,11 @@ jobs:
89130
- name: Checkout OpenActive.Server.NET
90131
uses: actions/checkout@v2
91132
with:
133+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
92134
path: server
135+
- name: Remove Nerdbank.GitVersioning as it interferes with the .NET Framework build
136+
run: del Directory.Build.props
137+
working-directory: server
93138
- name: Use matching coverage/* branch ${{ github.head_ref }} in OpenActive Test Suite
94139
if: ${{ startsWith(github.head_ref, 'coverage/') }}
95140
id: refs
@@ -135,6 +180,7 @@ jobs:
135180
with:
136181
name: framework.${{ matrix.mode }}.${{ matrix.profile }}
137182
path: ./tests/output/
183+
138184
deploy-reference-implementation:
139185
# Master branch only
140186
if: ${{ github.ref == 'refs/heads/master' }}
@@ -174,3 +220,80 @@ jobs:
174220
app-name: openactive-reference-implementation-auth
175221
publish-profile: ${{ secrets.AZURE_WEBAPP_AUTH_PUBLISH_PROFILE }} # Define secret variable in repository settings as per action documentation
176222
package: './web-app-package/BookingSystem.AspNetCore.IdentityServer'
223+
224+
publish-server:
225+
# Master branch only
226+
if: ${{ github.ref == 'refs/heads/master' }}
227+
needs:
228+
- core
229+
- framework
230+
runs-on: ubuntu-latest
231+
steps:
232+
- name: Checkout
233+
uses: actions/checkout@v2
234+
with:
235+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
236+
- name: Get current version
237+
uses: dotnet/nbgv@master
238+
id: nbgv
239+
- name: Setup .NET Core 3.1.419
240+
uses: actions/setup-dotnet@v1
241+
with:
242+
dotnet-version: 3.1.419
243+
- name: Install dependencies
244+
run: dotnet restore
245+
- name: Build
246+
run: dotnet build ./OpenActive.Server.NET/OpenActive.Server.NET.csproj --configuration Release --no-restore
247+
- name: Test
248+
run: dotnet test ./OpenActive.Server.NET.Tests/OpenActive.Server.NET.Tests.csproj --configuration Release --no-restore --verbosity normal
249+
- name: Pack
250+
run: dotnet pack ./OpenActive.Server.NET/OpenActive.Server.NET.csproj --configuration Release --include-source --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
251+
- name: Push to Nuget
252+
if: "! contains(toJSON(github.event.commits.*.message), '[no-release]')"
253+
run: dotnet nuget push "./OpenActive.Server.NET/**/*.nupkg" -k ${{secrets.NUGET_API_KEY}} --skip-duplicate -s https://api.nuget.org/v3/index.json
254+
- name: Create Release
255+
if: "! contains(toJSON(github.event.commits.*.message), '[no-release]')"
256+
id: create_release
257+
uses: actions/create-release@v1
258+
env:
259+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
260+
with:
261+
tag_name: v${{ steps.nbgv.outputs.SimpleVersion }}
262+
release_name: Release ${{ steps.nbgv.outputs.SimpleVersion }}
263+
body: |
264+
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)), and the latest version of the [Dataset Site Template](https://github.com/openactive/dataset-site-template).
265+
266+
Published to [Nuget](https://www.nuget.org/packages/OpenActive.Server.NET/${{ steps.nbgv.outputs.SimpleVersion }}).
267+
draft: false
268+
prerelease: false
269+
270+
publish-fake-database:
271+
# Master branch only
272+
if: ${{ github.ref == 'refs/heads/master' }}
273+
needs:
274+
- core
275+
- framework
276+
runs-on: ubuntu-latest
277+
steps:
278+
- name: Checkout
279+
uses: actions/checkout@v2
280+
with:
281+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
282+
- name: Get current version
283+
uses: dotnet/nbgv@master
284+
id: nbgv
285+
- name: Setup .NET Core 3.1.419
286+
uses: actions/setup-dotnet@v1
287+
with:
288+
dotnet-version: 3.1.419
289+
- name: Install dependencies
290+
run: dotnet restore
291+
- name: Build
292+
run: dotnet build ./Fakes/OpenActive.FakeDatabase.NET/OpenActive.FakeDatabase.NET.csproj --configuration Release --no-restore
293+
- name: Test
294+
run: dotnet test ./Fakes/OpenActive.FakeDatabase.NET.Tests/OpenActive.FakeDatabase.NET.Tests.csproj --configuration Release --no-restore --verbosity normal
295+
- name: Pack
296+
run: dotnet pack ./Fakes/OpenActive.FakeDatabase.NET/OpenActive.FakeDatabase.NET.csproj --configuration Release --include-source --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
297+
- name: Push to Nuget
298+
if: "! contains(toJSON(github.event.commits.*.message), '[no-release]')"
299+
run: dotnet nuget push "./Fakes/OpenActive.FakeDatabase.NET/**/*.nupkg" -k ${{secrets.NUGET_API_KEY}} --skip-duplicate -s https://api.nuget.org/v3/index.json

Directory.Build.props

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<PackageReference Include="Nerdbank.GitVersioning">
5+
<Version>3.5.108</Version>
6+
<PrivateAssets>all</PrivateAssets>
7+
</PackageReference>
8+
</ItemGroup>
9+
</Project>

Examples/BookingSystem.AspNetCore/BookingSystem.AspNetCore.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
<ItemGroup>
99
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.1.2" />
10-
<PackageReference Include="OpenActive.NET" Version="15.2.17" />
1110
</ItemGroup>
1211

1312
<ItemGroup>

Fakes/OpenActive.FakeDatabase.NET.Tests/OpenActive.FakeDatabase.NET.Tests.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
1111
<PackageReference Include="xunit" Version="2.4.0" />
1212
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
13-
<PackageReference Include="OpenActive.NET" Version="15.2.17" />
1413
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
1514
</ItemGroup>
1615

Fakes/OpenActive.FakeDatabase.NET/OpenActive.FakeDatabase.NET.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
3434
<PackageReference Include="ServiceStack.OrmLite.Sqlite.Core" Version="5.11.0" />
3535
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
36-
<PackageReference Include="OpenActive.NET" Version="15.2.17" />
36+
<PackageReference Include="OpenActive.NET" Version="15.2.21" />
3737
</ItemGroup>
3838

3939
<PropertyGroup>

OpenActive.Server.NET.Tests/OpenActive.Server.NET.Tests.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<PackageReference Include="xunit" Version="2.4.0" />
1212
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
1313
<PackageReference Include="coverlet.collector" Version="1.0.1" />
14-
<PackageReference Include="OpenActive.NET" Version="15.2.17" />
1514
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
1615
</ItemGroup>
1716

OpenActive.Server.NET/OpenActive.Server.NET.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<PrivateAssets>all</PrivateAssets>
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3232
</PackageReference>
33-
<PackageReference Include="OpenActive.DatasetSite.NET" Version="6.0.2" />
34-
<PackageReference Include="OpenActive.NET" Version="15.2.17" />
33+
<PackageReference Include="OpenActive.DatasetSite.NET" Version="6.0.4" />
34+
<PackageReference Include="OpenActive.NET" Version="15.2.21" />
3535
<PackageReference Include="UriTemplate.Core" Version="1.0.2" />
3636
</ItemGroup>
3737

version.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3+
"version": "0.13.0",
4+
"publicReleaseRefSpec": [
5+
"^refs/heads/master$"
6+
],
7+
"versionHeightOffset": -1,
8+
"cloudBuild": {
9+
"setVersionVariables": true,
10+
"buildNumber": {
11+
"enabled": true
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)