-
Notifications
You must be signed in to change notification settings - Fork 10
51 lines (48 loc) · 1.57 KB
/
dotnetcore.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
name: .NET Core
on:
push:
inputs:
version:
description: "Package Version"
required: true
default: "3.1.0.3-alpha"
workflow_dispatch:
inputs:
version:
description: "Package Version"
required: true
default: "3.1.0.3-alpha"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core 2.2
uses: actions/setup-dotnet@v3
with:
dotnet-version: 2.2.x
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
- name: Setup .NET 6
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Build with dotnet
run: dotnet build --configuration Release /p:ContinuousIntegrationBuild=true
- name: Test
run: dotnet test src/PostalCodes.UnitTests/PostalCodes.UnitTests.csproj
- name: Create nuget package
run: dotnet pack . -p:PackageVersion=${{ github.event.inputs.version }} -o out --no-build
- name: Install dotnet-validate
run: dotnet tool install --global dotnet-validate --version 0.0.1-preview.304
- name: Validate NuGet package
run: dotnet-validate package local out/*.nupkg
- name: Publish
run: |
dotnet nuget push src/PostalCodes/PostalCodes.${{ github.event.inputs.version }}.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json