-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (37 loc) · 1.46 KB
/
publish-nuget.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
35
36
37
38
39
40
41
42
43
44
45
46
name: Publish NuGet
on:
push:
branches:
- master
paths:
- '.github/workflows/publish-nuget.yml'
- 'src/Bannerlord.ModuleManager/**.cs'
workflow_dispatch:
jobs:
publish:
name: Publish on NuGet and GPR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.3.0
with:
fetch-depth: 0
- name: Setup .NET 6
uses: actions/setup-dotnet@master
with:
dotnet-version: 6.x.x
- name: Setup .NET 7
uses: actions/setup-dotnet@master
with:
dotnet-version: 7.x.x
- run: dotnet pack -c Release src/Bannerlord.ModuleManager -p:VersionOverride=$(git rev-list --no-merges --count master) -p:PackAsSource=false -o ./packages
- run: dotnet pack -c Release src/Bannerlord.ModuleManager -p:VersionOverride=$(git rev-list --no-merges --count master) -p:PackAsSource=true -o ./packages
- run: dotnet pack -c Release src/Bannerlord.ModuleManager.Native -p:VersionOverride=$(git rev-list --no-merges --count master) -o ./packages
- name: Push to NuGet
run: dotnet nuget push "./packages/*.nupkg" -k ${{secrets.NUGET_API_KEY}} -s https://www.nuget.org --skip-duplicate
shell: pwsh
- name: Push to GPR
run: |
for f in ./packages/*.nupkg
do
curl -vX PUT -u "vslee:${{secrets.GITHUB_TOKEN}}" -F package=@$f https://nuget.pkg.github.com/BUTR/
done