-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.34 KB
/
Copy pathrelease.yml
File metadata and controls
46 lines (36 loc) · 1.34 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:
release:
types: [published]
permissions:
contents: read
jobs:
publish:
name: Publish to NuGet.org
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- name: Extract version
id: version
run: echo "value=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
- name: Update template version
run: |
jq --arg v "${{ steps.version.outputs.value }}" \
'.symbols.caPackageVersion.defaultValue = $v' \
.template.config/template.json > tmp.json && mv tmp.json .template.config/template.json
- name: Pack template
env:
RELEASE_NOTES: ${{ github.event.release.body }}
run: dotnet pack CleanApiStarter.Template.csproj --configuration Release --output artifacts -p:PackageVersion=${{ steps.version.outputs.value }} -p:PackageReleaseNotes="$RELEASE_NOTES"
- name: Upload package artifact
uses: actions/upload-artifact@v7
with:
name: nuget-package
path: artifacts/*.nupkg
- name: Publish to NuGet
run: dotnet nuget push artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate