-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (74 loc) · 2.05 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
89
90
91
92
name: CI
on:
push:
branches:
- main
tags:
- v*
paths-ignore:
- docs/**
- LICENSE
- '**.md'
pull_request:
branches:
- main
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
- name: Clean
run: |
dotnet clean --configuration Release
dotnet nuget locals all --clear
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: |
dotnet test test/AspNetCoreJsModules.Tests/AspNetCoreJsModules.Tests.csproj --configuration Release --no-build --logger trx
- name: Test report
uses: dorny/test-reporter@v1
if: always()
with:
name: Test results
path: "**/*.trx"
reporter: dotnet-trx
- name: Package
run: dotnet pack src/AspNetCoreJsModules/AspNetCoreJsModules.csproj --configuration Release --no-build
env:
MINVERBUILDMETADATA: ${{ env.GITHUB_RUN_NUMBER }}
- name: Publish package artifact
uses: actions/upload-artifact@v3
with:
name: AspNetCoreJsModules.nupkg
path: src/AspNetCoreJsModules/bin/Release/*.nupkg
if-no-files-found: error
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@v2
with:
name: AspNetCoreJsModules.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 }}
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
generate_release_notes: true