Skip to content

Add support for using TypeId as dictionary keys with system.text.json #16

Add support for using TypeId as dictionary keys with system.text.json

Add support for using TypeId as dictionary keys with system.text.json #16

# 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