-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 1.23 KB
/
Copy pathpackage.yml
File metadata and controls
41 lines (33 loc) · 1.23 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
name: Build and publish NuGet package
on:
push:
tags: ["[0-9]+.[0-9]+.[0-9]+"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Environment
run: echo "RELEASE_VERSION=$(git describe --tags)" >> $GITHUB_ENV
- name: Build
run: |
dotnet build --configuration Release /p:Version=${{ env.RELEASE_VERSION }}
dotnet pack --configuration Release /p:Version=${{ env.RELEASE_VERSION }}
- name: GitHub Release
uses: softprops/action-gh-release@v1
with:
body: ${{ github.event.workflow_run.head_commit.message }}
files: bin/Release/RGBradCSharpTest.${{ env.RELEASE_VERSION }}.nupkg
- name: Push to GitHub NuGet registry
run: |
dotnet nuget push \
bin/Release/RGBradCSharpTest.${{ env.RELEASE_VERSION }}.nupkg \
--source https://nuget.pkg.github.com/brad-rocketgate/index.json \
--api-key ${{ secrets.GITHUB_TOKEN }}
- name: Push to NuGet.org registry
run: |
dotnet nuget push \
bin/Release/RGBradCSharpTest.${{ env.RELEASE_VERSION }}.nupkg \
--source https://api.nuget.org/v3/index.json \
--api-key ${{ secrets.NUGET_TOKEN }}