Skip to content

Commit a4712ff

Browse files
Merge pull request #120 from notion-dotnet/add-test-publish-code-github-pipeline
Add test publish code GitHub pipeline 👷🏼
2 parents ad418ca + 4112279 commit a4712ff

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Test Publish Code
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version'
8+
required: true
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v1
19+
with:
20+
dotnet-version: 5.0.x
21+
source-url: https://api.nuget.org/v3/index.json
22+
env:
23+
NUGET_AUTH_TOKEN: ${{secrets.NUGET_API_KEY}}
24+
25+
- name: Install dependencies
26+
run: |
27+
dotnet restore
28+
29+
- name: Build solution [Release]
30+
run: dotnet build --no-restore -c Release
31+
32+
- name: Test
33+
run: dotnet test -c Release --no-build --verbosity normal
34+
35+
- name: Pack solution [Release]
36+
run: |
37+
dotnet pack --no-restore --no-build -o PackOutputs -c Release -p:Version=${{ github.event.inputs.version }} -p:PackageReleaseNotes="See https://github.com/notion-dotnet/notion-sdk-net/releases/tag/${{ github.event.inputs.version }}" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
38+
echo 'Generated Packages'
39+
ls -l PackOutputs/
40+
rm -f PackOutputs/*.nupkg
41+
echo 'Packages After Removing nupkg'
42+
ls -l PackOutputs/
43+
dotnet pack --no-restore --no-build -o PackOutputs -c Release -p:Version=${{ github.event.inputs.version }} -p:PackageReleaseNotes="See https://github.com/notion-dotnet/notion-sdk-net/releases/tag/${{ github.event.inputs.version }}" -p:PackageReadmeFile=README.md
44+
echo 'Final Packages'
45+
ls -l PackOutputs/
46+
47+
- name: Upload artifacts
48+
uses: actions/upload-artifact@v2
49+
with:
50+
name: Notion.Net
51+
path: PackOutputs/*

0 commit comments

Comments
 (0)