-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (27 loc) · 1.09 KB
/
main.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
name: Publish Umami.NET
on:
push:
tags:
- 'v*.*.*' # This triggers the action for any tag that matches the pattern v1.0.0, v2.1.3, etc.
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x' # Specify the .NET version you need
- name: Restore dependencies
run: dotnet restore ./Umami.Net/Umami.Net.csproj
- name: Build project
run: dotnet build --configuration Release ./Umami.Net/Umami.Net.csproj --no-restore
- name: Run tests
run: dotnet test --configuration Release ./Umami.Net.Test/Umami.Net.Test.csproj
- name: Pack project
run: dotnet pack --configuration Release ./Umami.Net/Umami.Net.csproj --no-build --output ./nupkg
- name: Publish to NuGet
run: dotnet nuget push ./nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.UMAMI_NUGET_API_KEY }}
env:
NUGET_API_KEY: ${{ secrets.UMAMI_NUGET_API_KEY }}