-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (40 loc) · 1.21 KB
/
publish.yml
File metadata and controls
49 lines (40 loc) · 1.21 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
name: Publish
on:
push:
tags:
- "v*.*.*"
- "v*.*.*-*"
defaults:
run:
shell: bash
jobs:
nuget:
name: NuGet
environment: nuget
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
cache: true
cache-dependency-path: '**/packages.linux-x64.lock.json'
dotnet-version: |
8.x
10.x
- name: Write strong name key file
run: |
set +x # Disable command echoing for security
# Base64 decode the strong name key and save to keys directory
echo "$STRONG_NAME_KEY" | base64 -d > keys/NatsDistributedCache.2025-05-12.snk
chmod 600 keys/NatsDistributedCache.2025-05-12.snk
# Verify using the Docker-based script
./dev/verify-snk.sh
env:
STRONG_NAME_KEY: ${{secrets.STRONG_NAME_KEY}}
- name: Pack
run: dotnet pack -c Release -p:version=${GITHUB_REF#refs/*/v} -o ./publish
- name: Publish to NuGet.org
run: dotnet nuget push ./publish/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
env:
NUGET_API_KEY: ${{secrets.NUGET_API_KEY}}