Changes generated by 422d38a9bf852b7781fc8e7d2aa2d2c7e80a97c5 #59
Workflow file for this run
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: build_and_publish | |
on: push | |
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/checkout@v3.3.0 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '2.1.x' | |
- name: Restore | |
run: dotnet restore | |
- name: Build with dotnet | |
run: dotnet build --configuration Release | |
- name: Run Tests | |
run: dotnet test | |
- uses: actions/upload-artifact@v3.1.1 | |
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/download-artifact@v3.0.1 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '2.1.x' | |
- 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 |