-
Notifications
You must be signed in to change notification settings - Fork 9
88 lines (73 loc) · 2.12 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
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
81
82
83
84
85
86
87
88
name: ci
on:
push:
branches:
- dev
- main
tags:
- v*
paths-ignore:
- docs/**
- LICENSE
- '**.md'
pull_request:
branches:
- dev
- main
- v1.0
paths-ignore:
- docs/**
- LICENSE
- '**.md'
jobs:
build:
name: "Build & package"
runs-on: ubuntu-latest
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- name: Restore
run: dotnet restore
- name: Format
run: dotnet format --verify-no-changes
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Install Playwright
run: pwsh ./tests/GovUk.Frontend.AspNetCore.IntegrationTests/bin/Release/net8.0/playwright.ps1 install
- name: Test
run: |
dotnet test tests/GovUk.Frontend.AspNetCore.Tests/ --configuration Release --no-build
dotnet test tests/GovUk.Frontend.AspNetCore.ConformanceTests/ --configuration Release --no-build
dotnet test tests/GovUk.Frontend.AspNetCore.IntegrationTests/ --configuration Release --no-build
- name: Package
run: dotnet pack src/GovUk.Frontend.AspNetCore/ --configuration Release --no-build
env:
MINVERBUILDMETADATA: ${{ env.GITHUB_RUN_NUMBER }}
- name: Publish package artifact
uses: actions/upload-artifact@v4
with:
name: GovUk.Frontend.AspNetCore.nupkg
path: src/GovUk.Frontend.AspNetCore/bin/Release/*.nupkg
release:
name: "Release"
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download package artifact
uses: actions/download-artifact@v4
with:
name: GovUk.Frontend.AspNetCore.nupkg
- name: Publish package to NuGet
run: dotnet nuget push **/*.nupkg --api-key $NUGET_TOKEN --source https://api.nuget.org/v3/index.json --skip-duplicate
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}