Skip to content

Fixed CancellationTokenSource Issue #137

Fixed CancellationTokenSource Issue

Fixed CancellationTokenSource Issue #137

Workflow file for this run

name: .NET Core Build and Deploy
on:
push:
branches: master
pull_request:
branches: master
env:
MAJOR_MINOR_VERSION: 7.1.
SOLUTION_FILE: Agoda.LoadBalancing.sln
jobs:
build:
name: Build Package
runs-on: windows-latest # using windows agent for net462 build.
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore -p:Version=${{ env.MAJOR_MINOR_VERSION }}${{ github.run_number }}
# Run the tests, ideally should stop here if a fail and also publish results as artifacts
- name: Test
run: dotnet test
- name: Benchmark
run: ./Agoda.Frameworks.LoadBalancing.Benchmark/bin/Release/net6.0/Agoda.Frameworks.LoadBalancing.Benchmark
- name: Publish Benchmark Results artifact
uses: actions/upload-artifact@master
with:
name: BenchmarkDotNet
path: BenchmarkDotNet.Artifacts
- name: Pack Release
if: github.ref == 'refs/heads/master'
run: dotnet pack ${{ env.SOLUTION_FILE }} --configuration Debug -o finalpackage -p:Version=${{ env.MAJOR_MINOR_VERSION }}${{ github.run_number }} -p:PackageVersion=${{ env.MAJOR_MINOR_VERSION }}${{ github.run_number }}
- name: Pack Preview
if: github.ref != 'refs/heads/master'
run: dotnet pack ${{ env.SOLUTION_FILE }} --configuration Debug -o finalpackage -p:Version=${{ env.MAJOR_MINOR_VERSION }}${{ github.run_number }} -p:PackageVersion=${{ env.MAJOR_MINOR_VERSION }}${{ github.run_number }}-preview
- name: Publish nuget artifact
uses: actions/upload-artifact@v3
with:
name: nupkg
path: finalpackage
deploy:
needs: build
name: Deploy Packages
runs-on: ubuntu-latest
steps:
- name: Download Package artifact
uses: actions/download-artifact@v3
with:
name: nupkg
path: ./nupkg
- name: Setup NuGet
uses: NuGet/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
nuget-version: latest
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- name: Push to NuGet
run: dotnet nuget push nupkg/**/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate