-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.52 KB
/
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
43
44
45
46
47
48
name: NuGet Publish
on:
push:
tags:
- '*'
jobs:
nuget-publish:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
env:
NUGET_AUTH_TOKEN: ${{secrets.NUGET_TOKEN}}
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build /p:Version=$(git describe --tags)
- name: Test with dotnet
run: dotnet test --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
- name: Upload dotnet test results
uses: actions/upload-artifact@v4
with:
name: dotnet-results-${{ matrix.dotnet-version }}
path: TestResults-${{ matrix.dotnet-version }}
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: Create the package
run: dotnet pack --configuration Release src/KurzSharp /p:Version=$(git describe --tags)
- name: Publish the package
run: |
dotnet nuget push "src/KurzSharp/bin/Release/*.nupkg" --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}} --source https://api.nuget.org/v3/index.json
dotnet nuget push "src/KurzSharp/bin/Release/*.nupkg" --skip-duplicate --api-key ${{secrets.GITHUB_TOKEN}} --source https://nuget.pkg.github.com/ahmad2smile/index.json