4.3.0 release #34
Workflow file for this run
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: Publish Code | |
on: | |
release: | |
types: [published] | |
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 -c Release --filter "FullyQualifiedName~Notion.UnitTests" --no-build --verbosity normal | |
- name: Pack solution [Release] | |
run: | | |
dotnet pack --no-restore --no-build -o PackOutputs -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 }}" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg | |
rm -f PackOutputs/*.nupkg | |
dotnet pack --no-restore --no-build -o PackOutputs -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 }}" -p:PackageReadmeFile=README.md | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Notion.Net | |
path: PackOutputs/* | |
- name: Publish Nuget Package | |
run: dotnet nuget push PackOutputs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} | |
- name: Upload Nuget packages as release artifacts | |
uses: actions/github-script@v2 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
console.log('environment', process.versions); | |
const fs = require('fs').promises; | |
const { repo: { owner, repo }, sha } = context; | |
for (let file of await fs.readdir('PackOutputs')) { | |
console.log('uploading', file); | |
await github.repos.uploadReleaseAsset({ | |
owner, | |
repo, | |
release_id: ${{ github.event.release.id }}, | |
name: file, | |
data: await fs.readFile(`PackOutputs/${file}`) | |
}); | |
} |