-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.76 KB
/
Copy pathcd.yml
File metadata and controls
57 lines (46 loc) · 1.76 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
name: CD (Publish to NuGet & GitHub Release)
on:
push:
tags:
- 'v[0-9].*'
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Extract Version from Tag
id: get_version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Restore dependencies
run: dotnet restore
- name: Build Solution
run: dotnet build --configuration Release --no-restore
- name: Pack NuGet Package
run: dotnet pack src/Refit.Composite/Refit.Composite.csproj --configuration Release /p:PackageVersion=${{ env.VERSION }} --no-build --output ./dist
- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@v1
id: login
with:
user: HappyEntity
- name: Push to NuGet.org
run: dotnet nuget push ./dist/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
generate_release_notes: true
files: ./dist/*.nupkg