-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (56 loc) · 1.9 KB
/
release.yml
File metadata and controls
69 lines (56 loc) · 1.9 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
59
60
61
62
63
64
65
66
67
68
69
name: Publish to NuGet
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., 0.0.1)'
required: true
type: string
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
jobs:
publish:
name: Build, Pack & Publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore -p:Version=${{ inputs.version }}
- name: Pack
run: dotnet pack src/ObsKit.NET/ObsKit.NET.csproj --configuration Release --no-build -p:PackageVersion=${{ inputs.version }} --output ./nupkg
- name: Push to NuGet
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Create tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "v${{ inputs.version }}"
git push origin "v${{ inputs.version }}"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ inputs.version }}
name: v${{ inputs.version }}
body: |
## ObsKit.NET v${{ inputs.version }}
Install via NuGet:
```
dotnet add package ObsKit.NET --version ${{ inputs.version }}
```
Or via Package Manager:
```
Install-Package ObsKit.NET -Version ${{ inputs.version }}
```
files: ./nupkg/*.nupkg
generate_release_notes: true