-
Notifications
You must be signed in to change notification settings - Fork 242
47 lines (39 loc) · 1.45 KB
/
Copy pathrelease.yml
File metadata and controls
47 lines (39 loc) · 1.45 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
name: Release
on:
release:
types: [published]
jobs:
publish:
name: Publish
runs-on: windows-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Obtain SNK
id: obtain_snk
uses: timheuer/base64-to-file@a75dcdf3e46f8e5ac6765ca7598a7f0f3d1e5c0b # v1.0.3
with:
fileName: 'SigningKey.snk'
encodedString: ${{ secrets.SNK_BASE64 }}
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
10.0.x
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
working-directory: ./source
run: dotnet clean -c Release && dotnet nuget locals all --clear
- name: Pack
working-directory: ./source
run: dotnet pack -c Release /p:version=${{ github.event.release.tag_name }} /p:ContinuousIntegrationBuild=true /p:AssemblyOriginatorKeyFile=${{ steps.obtain_snk.outputs.filePath }} /p:ShouldSignAssembly=true
- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0
id: login
with:
user: rexm
- name: Publish to NuGet
working-directory: ./source
run: dotnet nuget push **/*.nupkg -k ${{ steps.login.outputs.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json