Test Publish Code #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Publish Code | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version' | |
| required: true | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v2 | |
| with: | |
| dotnet-version: 6.0.x | |
| source-url: https://api.nuget.org/v3/index.json | |
| env: | |
| NUGET_AUTH_TOKEN: ${{secrets.NUGET_API_KEY}} | |
| - name: Install dependencies | |
| run: | | |
| dotnet restore | |
| - name: Build solution [Release] | |
| run: dotnet build --no-restore -c Release | |
| - name: Test | |
| run: dotnet test --filter "FullyQualifiedName~Notion.UnitTests" -c Release --no-build --verbosity normal | |
| - name: Pack solution [Release] | |
| run: | | |
| 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 | |
| echo 'Generated Packages' | |
| ls -l PackOutputs/ | |
| rm -f PackOutputs/*.nupkg | |
| echo 'Packages After Removing nupkg' | |
| ls -l PackOutputs/ | |
| 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 | |
| echo 'Final Packages' | |
| ls -l PackOutputs/ | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Notion.Net | |
| path: PackOutputs/* |