forked from snerte/bunit.AutoMocker
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.07 KB
/
main.yml
File metadata and controls
45 lines (36 loc) · 1.07 KB
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
43
44
45
name: main
on:
workflow_dispatch:
pull_request:
types: [synchronize, opened, reopened]
push:
branches:
- main
env:
isMain: ${{ github.ref == 'refs/heads/main' }}
jobs:
create_nuget:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Use .NET 8.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Test
run: dotnet test
- name: Pack
run: dotnet pack --configuration Release --output ${{ runner.temp }}/nuget
- uses: actions/upload-artifact@v3
if: ${{ env.isMain == 'true' }}
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: ${{ runner.temp }}/nuget/*.nupkg
- name: Publish NuGet package
if: ${{ env.isMain == 'true' }}
run: dotnet nuget push ${{ runner.temp }}/nuget/*.nupkg --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json