-
Notifications
You must be signed in to change notification settings - Fork 15
42 lines (39 loc) · 1.06 KB
/
build_and_publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.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@v4
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@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.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