11on :
22 workflow_dispatch :
3- pull_request :
43permissions :
54 contents : read
65 pull-requests : write
@@ -17,12 +16,20 @@ jobs:
1716 uses : actions/checkout@v4
1817 - name : Build shared library
1918 working-directory : spannerlib
20- run : go build -o spannerlib.so -buildmode=c-shared
21- - name : Upload linux-x64
19+ run : go build -o spannerlib.so -buildmode=c-shared shared_lib.go
20+ - name : Build gRPC server
21+ working-directory : spannerlib
22+ run : go build grpc_server.go
23+ - name : Upload linux-x64 shared lib
2224 uses : actions/upload-artifact@v4
2325 with :
2426 name : spannerlib-linux-x64
2527 path : spannerlib/spannerlib.so
28+ - name : Upload linux-x64 gRPC server
29+ uses : actions/upload-artifact@v4
30+ with :
31+ name : spannerlib-server-linux-x64
32+ path : spannerlib/grpc_server
2633 build-osx-arm64 :
2734 runs-on : macos-latest
2835 steps :
@@ -34,28 +41,50 @@ jobs:
3441 uses : actions/checkout@v4
3542 - name : Build shared library
3643 working-directory : spannerlib
37- run : go build -o spannerlib.dylib -buildmode=c-shared
38- - name : Upload osx-arm64
44+ run : go build -o spannerlib.dylib -buildmode=c-shared shared_lib.go
45+ - name : Build gRPC server
46+ working-directory : spannerlib
47+ run : go build grpc_server.go
48+ - name : Upload osx-arm64 shared lib
3949 uses : actions/upload-artifact@v4
4050 with :
4151 name : spannerlib-osx-arm64
4252 path : spannerlib/spannerlib.dylib
53+ - name : Upload osx-arm64 gRPC server
54+ uses : actions/upload-artifact@v4
55+ with :
56+ name : spannerlib-server-osx-arm64
57+ path : spannerlib/grpc_server
4358 build-and-package :
4459 needs : [build-linux-x64, build-osx-arm64]
4560 runs-on : ubuntu-latest
4661 steps :
4762 - name : Checkout code
4863 uses : actions/checkout@v4
49- - name : Download and copy linux-x64
64+ - name : Download and copy linux-x64 shared lib
5065 uses : actions/download-artifact@v4
5166 with :
5267 name : spannerlib-linux-x64
5368 path : spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Native/libraries/linux-x64/
69+ - name : Download and copy linux-x64 gRPC server
70+ uses : actions/download-artifact@v4
71+ with :
72+ name : spannerlib-server-linux-x64
73+ path : spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Grpc/binaries/linux-x64/
74+ - name : Add execute permission to linux-x64 gRPC server
75+ run : chmod +x spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Grpc/binaries/linux-x64/grpc_server
5476 - name : Download and copy osx-arm64
5577 uses : actions/download-artifact@v4
5678 with :
5779 name : spannerlib-osx-arm64
5880 path : spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Native/libraries/osx-arm64/
81+ - name : Download and copy osx-arm64 gRPC server
82+ uses : actions/download-artifact@v4
83+ with :
84+ name : spannerlib-server-osx-arm64
85+ path : spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Grpc/binaries/osx-arm64/
86+ - name : Add execute permission to osx-arm64 gRPC server
87+ run : chmod +x spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Grpc/binaries/osx-arm64/grpc_server
5988 - name : Install dotnet
6089 uses : actions/setup-dotnet@v4
6190 with :
6594 - name : Build native library package
6695 run : dotnet pack
6796 working-directory : spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Native
68- - name : Add package source
97+ - name : Build gRPC server package
98+ run : dotnet pack
99+ working-directory : spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Grpc
100+ - name : Add package source for native library
69101 run : dotnet nuget add source "$PWD"/bin/Release --name local
70102 working-directory : spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Native
71103 - name : Restore dependencies
@@ -74,15 +106,9 @@ jobs:
74106 - name : Build
75107 run : dotnet build --no-restore
76108 working-directory : spannerlib/dotnet-spannerlib
77- - name : Unit Tests
78- working-directory : spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Tests
79- run : dotnet test --no-build --verbosity normal
80109 - name : Publish SpannerLib.Native to nuget
81110 run : dotnet nuget push bin/Release/Experimental.SpannerLib.Native.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
82111 working-directory : spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Native
83- - name : Build SpannerLib
84- run : dotnet pack
85- working-directory : spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib
86- - name : Publish SpannerLib to nuget
87- run : dotnet nuget push bin/Release/Experimental.SpannerLib.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
88- working-directory : spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib
112+ - name : Publish SpannerLib.Grpc to nuget
113+ run : dotnet nuget push bin/Release/Experimental.SpannerLib.Grpc.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
114+ working-directory : spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Grpc
0 commit comments