Skip to content

Upgrade

Upgrade #27

Workflow file for this run

name: publish nuget
on:
push:
tags:
- '**'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Print tag ref
run: echo $GITHUB_REF
- name: Extract version number
uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ github.ref }}
regex: '[0-9.]+'
- name: Print version number
run: echo '${{ steps.regex-match.outputs.match }}'
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: |
dotnet restore ./src/HaveIBeenPwned.Client.Abstractions/HaveIBeenPwned.Client.Abstractions.csproj
dotnet restore ./src/HaveIBeenPwned.Client/HaveIBeenPwned.Client.csproj
dotnet restore ./src/HaveIBeenPwned.Client.PollyExtensions/HaveIBeenPwned.Client.PollyExtensions.csproj
- name: Build
run: |
dotnet build ./src/HaveIBeenPwned.Client.Abstractions/HaveIBeenPwned.Client.Abstractions.csproj --configuration Release --no-restore
dotnet build ./src/HaveIBeenPwned.Client/HaveIBeenPwned.Client.csproj --configuration Release --no-restore
dotnet build ./src/HaveIBeenPwned.Client.PollyExtensions/HaveIBeenPwned.Client.PollyExtensions.csproj --configuration Release --no-restore
- name: Tests
run: dotnet test --filter "Category!=AcceptanceTests"
- name: Acceptance test
env:
HibpOptions__ApiKey: ${{ secrets.HibpOptions__ApiKey }}
run: dotnet test --filter "Category=AcceptanceTests"
- name: Pack
run: |
dotnet pack ./src/HaveIBeenPwned.Client.Abstractions/HaveIBeenPwned.Client.Abstractions.csproj --output packages
dotnet pack ./src/HaveIBeenPwned.Client/HaveIBeenPwned.Client.csproj --output packages
dotnet pack ./src/HaveIBeenPwned.Client.PollyExtensions/HaveIBeenPwned.Client.PollyExtensions.csproj --output packages
- name: Publish package
run: |
nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -NoSymbols -NonInteractive -ApiKey ${{secrets.NUGET_API_KEY}}
- name: Upload abstractions package
uses: actions/upload-artifact@main
with:
name: HaveIBeenPwned.Client.Abstractions.${{ steps.regex-match.outputs.match }}.nupkg
path: packages/
- name: Upload client package
uses: actions/upload-artifact@main
with:
name: HaveIBeenPwned.Client.${{ steps.regex-match.outputs.match }}.nupkg
path: packages/
- name: Upload polly extensions package
uses: actions/upload-artifact@main
with:
name: HaveIBeenPwned.Client.PollyExtensions.${{ steps.regex-match.outputs.match }}.nupkg
path: packages/