-
Notifications
You must be signed in to change notification settings - Fork 4
42 lines (39 loc) · 1.37 KB
/
build-serialization-jsonnet.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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Build Json.NET Serialization
on:
push:
branches:
- main
tags:
- 'typeid-jsonnet-v*'
paths:
- 'src/FastIDs.TypeId.Serialization/**'
pull_request:
branches:
- main
paths:
- 'src/FastIDs.TypeId.Serialization/**'
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src/FastIDs.TypeId.Serialization
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore ./TypeId.Serialization.JsonNet/TypeId.Serialization.JsonNet.csproj
- name: Build
run: dotnet build --no-restore --configuration Release ./TypeId.Serialization.JsonNet/TypeId.Serialization.JsonNet.csproj
- name: Test
run: dotnet test --configuration Release ./TypeId.Serialization.JsonNet.Tests/TypeId.Serialization.JsonNet.Tests.csproj
- name: Publish to NuGet
if: startsWith(github.ref, 'refs/tags/')
run: |
dotnet pack --no-build -c Release ./TypeId.Serialization.JsonNet -o .
dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate