-
-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (38 loc) · 1.28 KB
/
release.yaml
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
name: "🚀 Release"
on:
push:
branches:
- main
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout Repository
uses: actions/checkout@v3
- name: ✅ Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: 📦 Cache Packages
uses: actions/cache@v2
with:
path: |
~/.nuget/packages
!~/.nuget/packages/**/content
!~/.nuget/packages/**/contentFiles
key: ${{ runner.os }}-dotnet-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-dotnet-
- name: ⬇️ Restore Dependencies
run: dotnet restore
- name: 🏗️ Build
run: dotnet build -c Release --no-restore
- name: 🎁 Package
run: dotnet pack -c Release --no-build --property:PackageOutputPath=../../nupkgs
- name: ⬆️ Push to NuGet
run: dotnet nuget push "./nupkgs/*.nupkg" --skip-duplicate --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_PUBLISH_KEY }}
- name: 🎉 Create Release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: 'true'
makeLatest: 'true'