Skip to content

Merge pull request #113 from gocardless/bump-newtonsoft-json #52

Merge pull request #113 from gocardless/bump-newtonsoft-json

Merge pull request #113 from gocardless/bump-newtonsoft-json #52

name: gocardless/gocardless-dotnet/build_and_publish
on:
push:
branches:
- master
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
jobs:
build_and_test:
runs-on: ubuntu-latest
env:
OUT_DIR: "/GoCardless/bin/Release"
steps:
- uses: actions/[email protected]
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '2.1.x'
include-prerelease: true
- name: Restore
run: dotnet restore
- name: Build with dotnet
run: dotnet build --configuration Release
- name: Run Tests
run: dotnet test
- uses: actions/[email protected]
with:
path: "GoCardless/bin/Release/*.nupkg"
publish:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs:
- build_and_test
env:
OUT_DIR: "artifact"
steps:
- uses: actions/[email protected]
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '2.1.x'
include-prerelease: true
- name: Publish the library
run: dotnet nuget push artifact/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} -n --skip-duplicate