-
Notifications
You must be signed in to change notification settings - Fork 23
47 lines (36 loc) · 1.18 KB
/
Copy pathrelease.yml
File metadata and controls
47 lines (36 loc) · 1.18 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
name: Release
on:
push:
tags:
- "[0-9]*"
permissions:
contents: write
id-token: write
jobs:
release:
name: Pack and publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Restore
run: dotnet restore FastCache/FastCache.csproj
- name: Pack
run: dotnet pack FastCache/FastCache.csproj --configuration Release --no-restore --output ./artifacts /p:PackageVersion="${GITHUB_REF_NAME}"
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "${GITHUB_REF_NAME}" ./artifacts/*.nupkg --title "${GITHUB_REF_NAME}" --generate-notes
# Get a short-lived NuGet API key
- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@v1
id: login
with:
user: jitbit
# Push the package
- name: NuGet push
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate