-
Notifications
You must be signed in to change notification settings - Fork 15
97 lines (78 loc) · 2.36 KB
/
main.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
93
94
95
96
97
name: Main
on:
push:
branches:
- master
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Testing - run for any PRs.
pull_request:
branches:
- master
jobs:
# Build, test and publish (if this is a push/merge).
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Setup .NET 5.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Setup .NET 7.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
publish-package:
needs: build-and-test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core 8.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Pack
run: dotnet pack --no-build --configuration Release DataTables.Blazor/DataTables.Blazor.csproj --output .
- name: publish to nuget.org on version change
id: publish_nuget
uses: alirezanet/publish-nuget@v3.0.4
with:
PROJECT_FILE_PATH: DataTables.Blazor/DataTables.Blazor.csproj
VERSION_REGEX: <Version>(.*)<\/Version>
TAG_COMMIT: true
TAG_FORMAT: v*
INCLUDE_SYMBOLS: true
NO_BUILD: true
NUGET_KEY: ${{secrets.NUGET_KEY}}
- name: Publish to github packages
uses: tanaka-takayoshi/nuget-publish-to-github-packages-action@v2.1
with:
nupkg-path: '*.nupkg'
repo-owner: 'JustinWilkinson'
gh-user: 'JustinWilkinson'
token: ${{secrets.GITHUB_TOKEN}}