Skip to content

Commit 3ef4895

Browse files
Merge pull request #7 from notion-dotnet/add-gitHub-action-to-release-nuget-package
Add workflow to publish NuGet package on release
2 parents 173a8a9 + c4fba0b commit 3ef4895

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release to NuGet
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Setup .NET
15+
uses: actions/setup-dotnet@v1
16+
with:
17+
dotnet-version: 5.0.x
18+
19+
- name: Restore dependencies
20+
run: dotnet restore
21+
22+
- name: Build
23+
run: dotnet build --no-restore
24+
25+
- name: Test
26+
run: dotnet test --no-build --verbosity normal
27+
28+
- name: Create NuGet Package
29+
run: dotnet pack -c Release /p:Version=${{ github.event.release.tag_name }} /p:PackageReleaseNotes="See https://github.com/notion-dotnet/notion-sdk-net/releases/tag/${{ github.event.release.tag_name }}"
30+
working-directory: ./
31+
32+
- name: Archive NuGet Package
33+
uses: actions/upload-artifact@v1
34+
with:
35+
name: Notion.Net
36+
path: ./Src/Notion.Client/bin/Release/Notion.Net.${{ github.event.release.tag_name }}.nupkg
37+
38+
- name: Publish Nuget Package
39+
run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.nuget_api_key }} --source https://api.nuget.org/v3/index.json --no-symbols true

LICENSE renamed to LICENSE.md

File renamed without changes.

Src/Notion.Client/Notion.Client.csproj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,29 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<LangVersion>7.3</LangVersion>
6+
7+
<PackageId>Notion.Net</PackageId>
8+
<Authors>Vedant Koditkar</Authors>
9+
<Description>A Notion API dotnet client</Description>
10+
<RepositoryUrl>https://github.com/notion-dotnet/notion-sdk-net</RepositoryUrl>
11+
<PackageTags>notion;client;api;json;sdk;notion.net</PackageTags>
12+
<PackageIcon>notion-logo.png</PackageIcon>
13+
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
614
</PropertyGroup>
715

816
<ItemGroup>
917
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
1018
</ItemGroup>
1119

20+
<ItemGroup>
21+
<None Include="..\..\assets\notion-logo.png">
22+
<Pack>True</Pack>
23+
<PackagePath></PackagePath>
24+
</None>
25+
<None Include="..\..\LICENSE.md">
26+
<Pack>True</Pack>
27+
<PackagePath></PackagePath>
28+
</None>
29+
</ItemGroup>
30+
1231
</Project>

assets/notion-logo.png

9.12 KB
Loading

0 commit comments

Comments
 (0)