-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (33 loc) · 1.21 KB
/
nuget-publish.yml
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
name: NugetPublish
on:
release:
types: ["published"]
jobs:
build_and_publish:
name: Publish to Nuget
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6
- name: Build package
run: mkdir build && dotnet pack -c Release -o build -p:Version=${{ github.event.release.tag_name }} ./PluginLibrary/PluginLibrary.csproj
- name: Publish package
run: dotnet nuget push "build/*" -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Add to actions as artefact
uses: actions/upload-artifact@v3
with:
name: JulianusIV.PuSHPluginLibrary-${{ github.event.release.tag_name }}.zip
path: build/*
- name: Add files to release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: build/*
token: ${{ secrets.GH_TOKEN }}
omitBodyDuringUpdate: true # We don't want to update the body of the release.
omitNameDuringUpdate: true # We don't want to update the name of the release.