Skip to content

Use singleton key to avoid azure rate limits #17

Use singleton key to avoid azure rate limits

Use singleton key to avoid azure rate limits #17

Workflow file for this run

name: Publish
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.x'
- name: Build
run: |
dotnet restore Rusty.Jwt/Rusty.Jwt.csproj
dotnet restore Rusty.Jwt.Azure/Rusty.Jwt.Azure.csproj
dotnet build -c Release --no-restore Rusty.Jwt/Rusty.Jwt.csproj
dotnet build -c Release --no-restore Rusty.Jwt.Azure/Rusty.Jwt.Azure.csproj
dotnet pack -c Release --no-build -o packages Rusty.Jwt/Rusty.Jwt.csproj
dotnet pack -c Release --no-build -o packages Rusty.Jwt.Abstractions/Rusty.Jwt.Abstractions.csproj
dotnet pack -c Release --no-build -o packages Rusty.Jwt.Azure/Rusty.Jwt.Azure.csproj
- name: Upload Artifacts
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
uses: actions/upload-artifact@v2
with:
name: nuget
path: packages/*.nupkg
test:
name: Test
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.x'
- name: Test
run: |
dotnet test -c Release \
-p:CollectCoverage=true \
-p:CoverletOutputFormat=cobertura \
-p:CoverletOutput=./Coverage/Rusty.Jwt.Tests/ \
Rusty.Jwt.Tests/Rusty.Jwt.Tests.csproj
dotnet test -c Release \
-p:CollectCoverage=true \
-p:CoverletOutputFormat=cobertura \
-p:CoverletOutput=./Coverage/Rusty.Jwt.Azure.Tests/ \
Rusty.Jwt.Azure.Tests/Rusty.Jwt.Azure.Tests.csproj
env:
AZURE_TENANT_ID: ${{secrets.AZURE_TENANT_ID}}
AZURE_CLIENT_ID: ${{secrets.AZURE_CLIENT_ID}}
AZURE_CLIENT_SECRET: ${{secrets.AZURE_CLIENT_SECRET}}
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v1
with:
files: >
./Coverage/Rusty.Jwt.Tests/coverage.cobertura.xml,./Coverage/Rusty.Jwt.Azure.Tests/coverage.cobertura.xml
publish:
name: Publish
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
runs-on: ubuntu-latest
needs: test
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: nuget
path: packages/
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.x'
- name: Publish Rusty.Jwt
run: dotnet nuget push packages/Rusty.Jwt.*.*.*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://www.nuget.org/api/v2/package --skip-duplicate
- name: Publish Rusty.Jwt.Abstractions
run: dotnet nuget push packages/Rusty.Jwt.Abstractions.*.*.*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://www.nuget.org/api/v2/package --skip-duplicate
- name: Publish Rusty.Jwt.Azure
run: dotnet nuget push packages/Rusty.Jwt.Azure.*.*.*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://www.nuget.org/api/v2/package --skip-duplicate