-
-
Notifications
You must be signed in to change notification settings - Fork 96
58 lines (56 loc) · 1.74 KB
/
publish.yml
File metadata and controls
58 lines (56 loc) · 1.74 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
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Publish NuGet
on:
push:
paths-ignore:
- docs/**
- '*.md'
tags:
- '*'
jobs:
nuget:
runs-on: [ self-hosted, type-cpx52, setup-docker, volume-cache-50GB ]
env:
NUGET_PACKAGES: "/mnt/cache/.nuget/packages"
DOTNET_INSTALL_DIR: "/mnt/cache/.dotnet"
steps:
-
name: Setup Python
uses: actions/setup-python@v6
with:
python-version: 3.8
-
name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.200'
-
name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
-
name: Login to Docker Hub
if: ${{ github.event.pull_request.head.repo.fork == false }}
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
-
name: Run tests
run: dotnet test --framework net10.0
-
name: Publish test results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
if: always()
with:
files: |
test-results/**/*.xml
test-results/**/*.trx
-
name: Create and push NuGet package
run: |
dotnet pack -c Release -o nuget -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
dotnet nuget push nuget/**/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push nuget/**/*.nupkg --api-key ${{ secrets.MYGET_API_KEY }} --source https://www.myget.org/F/${{ vars.MYGET_FEED_NAME || 'eventuous' }}/api/v2/package --skip-duplicate
env:
NUGET_AUTH_TOKEN: ${{ github.token }}