-
-
Notifications
You must be signed in to change notification settings - Fork 55
56 lines (44 loc) · 1.28 KB
/
release.yml
File metadata and controls
56 lines (44 loc) · 1.28 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
name: Release
on:
workflow_dispatch:
release:
types: [published]
permissions:
contents: write
id-token: write
jobs:
release:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release -warnaserror
- name: Test
run: dotnet test --no-build -c Release
- name: Pack
run: dotnet pack --no-restore -c Release -o ./artifacts
- name: List packages
run: ls -la ./artifacts
- name: NuGet Login
if: github.event_name == 'release'
id: nuget-login
uses: nuget/login@v1
with:
user: Kralizek
- name: Publish to NuGet
if: github.event_name == 'release'
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Add to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v3
with:
files: |
./artifacts/*.nupkg