feat(ci): use github actions deploy NuGet packages. #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SimpleRpc-CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 7.0.x | |
- name: Restore dependencies | |
run: | | |
dotnet restore ./SimpleRpc.sln | |
- name: Build project and Generate NuGet package | |
run: | | |
cd ./src/ | |
dotnet build --configuration Release --nologo ./SimpleRpc.Shared/SimpleRpc.Shared.csproj || true | |
dotnet build --configuration Release --nologo ./SimpleRpc.Server/SimpleRpc.Server.csproj || true | |
dotnet build --configuration Release --nologo ./SimpleRpc.Client/SimpleRpc.Client.csproj || true | |
dotnet pack -c Release --nologo ./SimpleRpc.Shared/SimpleRpc.Shared.csproj -o ../../nupkgs || true | |
dotnet pack -c Release --nologo ./SimpleRpc.Server/SimpleRpc.Server.csproj -o ../../nupkgs || true | |
dotnet pack -c Release --nologo ./SimpleRpc.Client/SimpleRpc.Client.csproj -o ../../nupkgs || true | |
# Runs a set of commands using the runners shell | |
- name: Publish nuget package. | |
run: | | |
dotnet nuget push ./src/*.symbols.nupkg --no-symbols true --skip-duplicate true -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json || true |