Skip to content

Commit

Permalink
Merge pull request #239 from Cysharp/v3
Browse files Browse the repository at this point in the history
MessagePack for C# v2
  • Loading branch information
neuecc authored Dec 26, 2019
2 parents c54092f + bcc064d commit dcd3a13
Show file tree
Hide file tree
Showing 2,632 changed files with 54,937 additions and 90,682 deletions.
132 changes: 87 additions & 45 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ orbs:
executors:
dotnet:
docker:
- image: mcr.microsoft.com/dotnet/core/sdk:2.2
- image: mcr.microsoft.com/dotnet/core/sdk:3.1
environment:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
NUGET_XMLDOC_MODE: skip
Expand Down Expand Up @@ -48,10 +48,11 @@ jobs:
steps:
- git-shallow-clone/checkout_shallow
- run: dotnet build ./src/MagicOnion/ -c Debug
- run: dotnet build ./src/MagicOnion.Abstractions/ -c Debug
- run: dotnet build ./src/MagicOnion.Hosting/ -c Debug
- run: dotnet build ./src/MagicOnion.HttpGateway/ -c Debug
- run: dotnet build ./src/MagicOnion.Redis/ -c Debug
- run: dotnet build ./src/MagicOnion.UniversalCodeGenerator/ -c Debug
# - run: dotnet build ./src/MagicOnion.UniversalCodeGenerator/ -c Debug
- run: dotnet build ./src/MagicOnion.OpenTelemetry/ -c Debug
- run: dotnet test ./tests/MagicOnion.NetCoreTests/ -c Debug
- run: dotnet test ./tests/MagicOnion.Hosting.Tests/ -c Debug
Expand All @@ -61,73 +62,44 @@ jobs:
- git-shallow-clone/checkout_shallow
# build .NET Core projects
- run: dotnet build ./src/MagicOnion/ -c Release -p:Version=${CIRCLE_TAG}
- run: dotnet build ./src/MagicOnion.Abstractions/ -c Release -p:Version=${CIRCLE_TAG}
- run: dotnet build ./src/MagicOnion.Hosting/ -c Release -p:Version=${CIRCLE_TAG}
- run: dotnet build ./src/MagicOnion.HttpGateway/ -c Release -p:Version=${CIRCLE_TAG}
- run: dotnet build ./src/MagicOnion.Redis/ -c Release -p:Version=${CIRCLE_TAG}
- run: dotnet build ./src/MagicOnion.OpenTelemetry/ -c Release -p:Version=${CIRCLE_TAG}
- run: dotnet build ./src/MagicOnion.MSBuild.Tasks/ -c Release -p:Version=${CIRCLE_TAG}
- run: dotnet build ./src/MagicOnion.Generator/ -c Release -p:Version=${CIRCLE_TAG}
# tests
# - run: dotnet test ./tests/MagicOnion.NetCoreTests/ -c Release
# - run: dotnet test ./tests/MagicOnion.Hosting.Tests/ -c Release
# pack nuget
- run: dotnet pack ./src/MagicOnion/MagicOnion.csproj -c Release --no-build -p:Version=${CIRCLE_TAG}
- run: dotnet pack ./src/MagicOnion.Abstractions/MagicOnion.Abstractions.csproj -c Release --no-build -p:Version=${CIRCLE_TAG}
- run: dotnet pack ./src/MagicOnion.Hosting/MagicOnion.Hosting.csproj -c Release --no-build -p:Version=${CIRCLE_TAG}
- run: dotnet pack ./src/MagicOnion.HttpGateway/MagicOnion.HttpGateway.csproj -c Release --no-build -p:Version=${CIRCLE_TAG}
- run: dotnet pack ./src/MagicOnion.Redis/MagicOnion.Redis.csproj -c Release --no-build -p:Version=${CIRCLE_TAG}
- run: dotnet pack ./src/MagicOnion.OpenTelemetry/MagicOnion.OpenTelemetry.csproj -c Release --no-build -p:Version=${CIRCLE_TAG}
- run: dotnet pack ./src/MagicOnion.MSBuild.Tasks/MagicOnion.MSBuild.Tasks.csproj -c Release --no-build -p:Version=${CIRCLE_TAG}
- run: dotnet pack ./src/MagicOnion.Generator/MagicOnion.Generator.csproj -c Release --no-build -p:Version=${CIRCLE_TAG}
# publish moc
- run: dotnet publish ./src/MagicOnion.UniversalCodeGenerator/ -c Release --self-contained -r win-x64 -o ./bin/moc/win-x64
- run: dotnet publish ./src/MagicOnion.UniversalCodeGenerator/ -c Release --self-contained -r linux-x64 -o ./bin/moc/linux-x64
- run: dotnet publish ./src/MagicOnion.UniversalCodeGenerator/ -c Release --self-contained -r osx-x64 -o ./bin/moc/osx-x64
- run: dotnet publish ./src/MagicOnion.Generator/ -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true /p:IncludeSymbolsInSingleFile=true --self-contained -r win-x64 -o ./src/MagicOnion.Generator/bin/moc/win-x64
- run: dotnet publish ./src/MagicOnion.Generator/ -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true /p:IncludeSymbolsInSingleFile=true --self-contained -r linux-x64 -o ./src/MagicOnion.Generator/bin/moc/linux-x64
- run: dotnet publish ./src/MagicOnion.Generator/ -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true /p:IncludeSymbolsInSingleFile=true --self-contained -r osx-x64 -o ./src/MagicOnion.Generator/bin/moc/osx-x64
- run: apt update && apt install zip -y
- run: zip -r moc.zip ./src/MagicOnion.UniversalCodeGenerator/bin/moc
- run: zip -r moc.zip ./src/MagicOnion.Generator/bin/moc
- persist_to_workspace:
root: .
paths:
- ./moc.zip
# push to NuGet Server
- run: dotnet nuget push ./src/MagicOnion/bin/Release/MagicOnion.${CIRCLE_TAG}.nupkg -s https://www.nuget.org/api/v2/package -k ${NUGET_KEY}
- run: dotnet nuget push ./src/MagicOnion.Abstractions/bin/Release/MagicOnion.Abstractions.${CIRCLE_TAG}.nupkg -s https://www.nuget.org/api/v2/package -k ${NUGET_KEY}
- run: dotnet nuget push ./src/MagicOnion.Hosting/bin/Release/MagicOnion.Hosting.${CIRCLE_TAG}.nupkg -s https://www.nuget.org/api/v2/package -k ${NUGET_KEY}
- run: dotnet nuget push ./src/MagicOnion.HttpGateway/bin/Release/MagicOnion.HttpGateway.${CIRCLE_TAG}.nupkg -s https://www.nuget.org/api/v2/package -k ${NUGET_KEY}
- run: dotnet nuget push ./src/MagicOnion.Redis/bin/Release/MagicOnion.Redis.${CIRCLE_TAG}.nupkg -s https://www.nuget.org/api/v2/package -k ${NUGET_KEY}
- run: dotnet nuget push ./src/MagicOnion.OpenTelemetry/bin/Release/MagicOnion.OpenTelemetry.${CIRCLE_TAG}.nupkg -s https://www.nuget.org/api/v2/package -k ${NUGET_KEY}

build-push-canary:
executor: dotnet
steps:
- git-shallow-clone/checkout_shallow
- run: echo "export MAGICONION_VERSION=`echo ci-\`date '+%Y%m%d-%H%M%S'\`+${CIRCLE_SHA1:0:6}`" >> $BASH_ENV
- run: echo "MAGICONION_VERSION=${MAGICONION_VERSION}"
# build .NET Core projects
- run: dotnet build ./src/MagicOnion/ -c Release -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet build ./src/MagicOnion.Hosting/ -c Release -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet build ./src/MagicOnion.HttpGateway/ -c Release -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet build ./src/MagicOnion.Redis/ -c Release -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet build ./src/MagicOnion.OpenTelemetry/ -c Release -p:VersionSuffix=${MAGICONION_VERSION}
# tests
# - run: dotnet test ./tests/MagicOnion.NetCoreTests/ -c Release
# - run: dotnet test ./tests/MagicOnion.Hosting.Tests/ -c Release
# pack nuget
- run: dotnet pack ./src/MagicOnion/MagicOnion.csproj -c Release --include-symbols --include-source --no-build -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet pack ./src/MagicOnion.Hosting/MagicOnion.Hosting.csproj -c Release --include-symbols --include-source --no-build -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet pack ./src/MagicOnion.HttpGateway/MagicOnion.HttpGateway.csproj -c Release --include-symbols --include-source --no-build -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet pack ./src/MagicOnion.Redis/MagicOnion.Redis.csproj -c Release --include-symbols --include-source --no-build -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet pack ./src/MagicOnion.OpenTelemetry/MagicOnion.OpenTelemetry.csproj -c Release --include-symbols --include-source --no-build -p:VersionSuffix=${MAGICONION_VERSION}
# publish moc
- run: dotnet publish ./src/MagicOnion.UniversalCodeGenerator/ -c Release --self-contained -r win-x64 -o ./bin/moc/win-x64
- run: dotnet publish ./src/MagicOnion.UniversalCodeGenerator/ -c Release --self-contained -r linux-x64 -o ./bin/moc/linux-x64
- run: dotnet publish ./src/MagicOnion.UniversalCodeGenerator/ -c Release --self-contained -r osx-x64 -o ./bin/moc/osx-x64
- run: apt update && apt install zip -y
- run: zip -r moc.zip ./src/MagicOnion.UniversalCodeGenerator/bin/moc
- store_artifacts:
path: ./moc.zip
# push to NuGet Server
- run: echo "export NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED=true" >> $BASH_ENV
- run: wget -qO- https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh | bash
- run: dotnet nuget push ./src/MagicOnion/bin/Release/MagicOnion.*.nupkg -s https://pkgs.dev.azure.com/cysharp/MagicOnion/_packaging/Canary/nuget/v2 -k AzureDevOps
- run: dotnet nuget push ./src/MagicOnion.Hosting/bin/Release/MagicOnion.Hosting.*.nupkg -s https://pkgs.dev.azure.com/cysharp/MagicOnion/_packaging/Canary/nuget/v2 -k AzureDevOps
- run: dotnet nuget push ./src/MagicOnion.HttpGateway/bin/Release/MagicOnion.HttpGateway.*.nupkg -s https://pkgs.dev.azure.com/cysharp/MagicOnion/_packaging/Canary/nuget/v2 -k AzureDevOps
- run: dotnet nuget push ./src/MagicOnion.Redis/bin/Release/MagicOnion.Redis.*.nupkg -s https://pkgs.dev.azure.com/cysharp/MagicOnion/_packaging/Canary/nuget/v2 -k AzureDevOps
- run: dotnet nuget push ./src/MagicOnion.OpenTelemetry/bin/Release/MagicOnion.OpenTelemetry.*.nupkg -s https://pkgs.dev.azure.com/cysharp/MagicOnion/_packaging/Canary/nuget/v2 -k AzureDevOps
- run: dotnet nuget push ./src/MagicOnion.MSBuild.Tasks/bin/Release/MagicOnion.MSBuild.Tasks.${CIRCLE_TAG}.nupkg -s https://www.nuget.org/api/v2/package -k ${NUGET_KEY}
- run: dotnet nuget push ./src/MagicOnion.Generator/bin/Release/MagicOnion.Generator.${CIRCLE_TAG}.nupkg -s https://www.nuget.org/api/v2/package -k ${NUGET_KEY}

# upload to github by ghr
upload-github:
Expand Down Expand Up @@ -227,6 +199,65 @@ jobs:
- store_artifacts:
path: ./samples/ChatApp/ChatApp.Unity/build/
destination: /samples/android/

# Canary build and push NuGet
canary-build-and-push-nuget:
executor: dotnet
steps:
- git-shallow-clone/checkout_shallow
- run: echo "export MAGICONION_VERSION=`echo ci-\`date '+%Y%m%d-%H%M%S'\`+${CIRCLE_SHA1:0:6}`" >> $BASH_ENV
- run: echo "MAGICONION_VERSION=${MAGICONION_VERSION}"
# build .NET Core projects
- run: dotnet build ./src/MagicOnion/ -c Release -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet build ./src/MagicOnion.Abstractions/ -c Release -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet build ./src/MagicOnion.Hosting/ -c Release -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet build ./src/MagicOnion.HttpGateway/ -c Release -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet build ./src/MagicOnion.Redis/ -c Release -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet build ./src/MagicOnion.OpenTelemetry/ -c Release -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet build ./src/MagicOnion.MSBuild.Tasks/ -c Release -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet build ./src/MagicOnion.Generator/ -c Release -p:VersionSuffix=${MAGICONION_VERSION}
# tests
# - run: dotnet test ./tests/MagicOnion.NetCoreTests/ -c Release
# - run: dotnet test ./tests/MagicOnion.Hosting.Tests/ -c Release
# pack nuget
- run: dotnet pack ./src/MagicOnion/MagicOnion.csproj -c Release --include-symbols --include-source --no-build -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet pack ./src/MagicOnion.Abstractions/MagicOnion.Abstractions.csproj -c Release --include-symbols --include-source --no-build -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet pack ./src/MagicOnion.Hosting/MagicOnion.Hosting.csproj -c Release --include-symbols --include-source --no-build -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet pack ./src/MagicOnion.HttpGateway/MagicOnion.HttpGateway.csproj -c Release --include-symbols --include-source --no-build -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet pack ./src/MagicOnion.Redis/MagicOnion.Redis.csproj -c Release --include-symbols --include-source --no-build -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet pack ./src/MagicOnion.OpenTelemetry/MagicOnion.OpenTelemetry.csproj -c Release --include-symbols --include-source --no-build -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet pack ./src/MagicOnion.MSBuild.Tasks/MagicOnion.MSBuild.Tasks.csproj -c Release --include-symbols --include-source --no-build -p:VersionSuffix=${MAGICONION_VERSION}
- run: dotnet pack ./src/MagicOnion.Generator/MagicOnion.Generator.csproj -c Release --include-symbols --include-source --no-build -p:VersionSuffix=${MAGICONION_VERSION}
# publish moc
- run: dotnet publish ./src/MagicOnion.Generator/ -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true /p:IncludeSymbolsInSingleFile=true --self-contained -r win-x64 -o ./src/MagicOnion.Generator/bin/moc/win-x64
- run: dotnet publish ./src/MagicOnion.Generator/ -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true /p:IncludeSymbolsInSingleFile=true --self-contained -r linux-x64 -o ./src/MagicOnion.Generator/bin/moc/linux-x64
- run: dotnet publish ./src/MagicOnion.Generator/ -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true /p:IncludeSymbolsInSingleFile=true --self-contained -r osx-x64 -o ./src/MagicOnion.Generator/bin/moc/osx-x64
- run: apt update && apt install zip -y
- run: zip -r moc.zip ./src/MagicOnion.Generator/bin/moc
- store_artifacts:
path: ./moc.zip

# push to NuGet Server
- run: echo "export NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED=true" >> $BASH_ENV
- run: wget -qO- https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh | bash
- run: dotnet nuget push ./src/MagicOnion/bin/Release/MagicOnion.*.nupkg -s https://pkgs.dev.azure.com/cysharp/MagicOnion/_packaging/Canary/nuget/v2 -k AzureDevOps
- run: dotnet nuget push ./src/MagicOnion.Abstractions/bin/Release/MagicOnion.Abstractions.*.nupkg -s https://pkgs.dev.azure.com/cysharp/MagicOnion/_packaging/Canary/nuget/v2 -k AzureDevOps
- run: dotnet nuget push ./src/MagicOnion.Hosting/bin/Release/MagicOnion.Hosting.*.nupkg -s https://pkgs.dev.azure.com/cysharp/MagicOnion/_packaging/Canary/nuget/v2 -k AzureDevOps
- run: dotnet nuget push ./src/MagicOnion.HttpGateway/bin/Release/MagicOnion.HttpGateway.*.nupkg -s https://pkgs.dev.azure.com/cysharp/MagicOnion/_packaging/Canary/nuget/v2 -k AzureDevOps
- run: dotnet nuget push ./src/MagicOnion.Redis/bin/Release/MagicOnion.Redis.*.nupkg -s https://pkgs.dev.azure.com/cysharp/MagicOnion/_packaging/Canary/nuget/v2 -k AzureDevOps
- run: dotnet nuget push ./src/MagicOnion.OpenTelemetry/bin/Release/MagicOnion.OpenTelemetry.*.nupkg -s https://pkgs.dev.azure.com/cysharp/MagicOnion/_packaging/Canary/nuget/v2 -k AzureDevOps
- run: dotnet nuget push ./src/MagicOnion.MSBuild.Tasks/bin/Release/MagicOnion.MSBuild.Tasks.*.nupkg -s https://pkgs.dev.azure.com/cysharp/MagicOnion/_packaging/Canary/nuget/v2 -k AzureDevOps
- run: dotnet nuget push ./src/MagicOnion.Generator/bin/Release/MagicOnion.Generator.*.nupkg -s https://pkgs.dev.azure.com/cysharp/MagicOnion/_packaging/Canary/nuget/v2 -k AzureDevOps

canary-push:
executor: dotnet
steps:
- attach_workspace:
at: .
- store_artifacts:
path: MagicOnion.Client.Unity.unitypackage
destination: MagicOnion.Client.Unity.unitypackage

workflows:
version: 2
build-and-push:
Expand Down Expand Up @@ -258,8 +289,19 @@ workflows:
# filters:
# tags:
# only: /.*/
- build-push-canary:

- canary-build-and-push-nuget:
filters:
branches:
only:
- master
- v3
- canary-push:
requires:
- canary-build-and-push-nuget
- build-unity
filters:
branches:
only:
- master
- v3
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,5 @@ nuget/*.unitypackage
# Jetbrains Rider
.idea/
src/MagicOnion.Client.Unity/Packages/manifest.json

packages
13 changes: 12 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>7.3</LangVersion>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<VersionPrefix>2.7.2</VersionPrefix>
<VersionPrefix>3.0.0</VersionPrefix>

<!-- NuGet Packaging -->
<PackageVersion>$(Version)</PackageVersion>
<Company>Cysharp</Company>
<Authors>Cysharp</Authors>
<Copyright>© Cysharp, Inc.</Copyright>
<PackageTags>magiconion;grpc;http2</PackageTags>
<PackageProjectUrl>https://github.com/Cysharp/MagicOnion</PackageProjectUrl>
<RepositoryUrl>$(PackageProjectUrl)</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
</Project>
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2016 Yoshifumi Kawai
Copyright (c) Yoshifumi Kawai
Copyright (c) Cysharp, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit dcd3a13

Please sign in to comment.