This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
Merge pull request #134 from duffelhq/dependabot/nuget/NUnit-4.2.2 #333
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: .NET | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+" | |
- "[0-9]+.[0-9]+.[0-9]+-RC[0-9]+" | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore packages, build and test | |
run: dotnet test | |
publish: | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'duffelhq/duffel-api-dotnet' | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 6.0.x | |
- name: Build package | |
run: dotnet pack -c Release -o ./output | |
- name: Publish | |
run: dotnet nuget push ./output/Duffel.ApiClient.*.nupkg -k ${{secrets.NUGET_API_KEY}} -s 'https://api.nuget.org/v3/index.json' | |