-
-
Notifications
You must be signed in to change notification settings - Fork 3
95 lines (82 loc) · 2.82 KB
/
main.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# This is a basic workflow to help you get started with Actions
name: publish to nuget
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ main ]
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
- '**/*.gitattributes'
- '.github/**/*.*'
workflow_dispatch:
permissions:
contents: read
env:
DOTNETVERSION: 8.0
DOTNET_NOLOGO: true # Disable the .NET logo
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '${{env.DOTNETVERSION}}'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release
- name: Pack
run: dotnet pack --configuration Release --no-build
publish:
runs-on: ubuntu-latest
needs: build
steps:
# - name: Set up NuGet CLI
# run: dotnet tool install --global NuGet.CommandLine
- name: Push NuGet package
run: |
dotnet nuget push **/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}}
# publish:
# name: build, pack & publish
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
#
# # - name: Setup dotnet
# # uses: actions/setup-dotnet@v1
# # with:
# # dotnet-version: 3.1.200
#
# # Publish
# - name: publish NotionSharp on nuget on change
# id: publish_nuget_notionsharp
# uses: rohith/publish-nuget@v2
# with:
# # Filepath of the project to be packaged, relative to root of repository
# PROJECT_FILE_PATH: NotionSharp/NotionSharp.csproj
#
# # NuGet package id, used for version detection & defaults to project name
# PACKAGE_NAME: Softlion.NotionSharp
#
# # API key to authenticate with NuGet server
# NUGET_KEY: ${{secrets.NUGET_API_KEY}}
#
# - name: publish NotionSharp project templates on nuget on change
# id: publish_nuget_notionsharp_projecttemplates
# uses: rohith/publish-nuget@v2
# with:
# # Filepath of the project to be packaged, relative to root of repository
# PROJECT_FILE_PATH: Demos/PackTemplateProjects.csproj
#
# # NuGet package id, used for version detection & defaults to project name
# PACKAGE_NAME: Softlion.NotionSharp.TemplateProjects
#
# # API key to authenticate with NuGet server
# NUGET_KEY: ${{secrets.NUGET_API_KEY}}