Release v0.5.1 #12
Workflow file for this run
This file contains 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: Release Workflow | |
on: | |
release: | |
types: [created] | |
env: | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
DOTNET_NOLOGO: true | |
NuGetDirectory: ${{ github.workspace }}/nuget | |
defaults: | |
run: | |
shell: pwsh | |
jobs: | |
create-package: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup dotnet 8.0 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: "8.0.x" | |
- name: Create Package | |
run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: nuget | |
if-no-files-found: error | |
retention-days: 7 | |
path: ${{ env.NuGetDirectory }}/*.nupkg | |
validate-package: | |
needs: [create-package] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup dotnet 8.0 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: "8.0.x" | |
- uses: actions/download-artifact@v3 | |
with: | |
name: nuget | |
path: ${{ env.NuGetDirectory }} | |
- name: Install NuGet Package Validation Tool | |
run: dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global | |
- name: Validate package | |
run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg") | |
publish-package: | |
needs: [validate-package] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup dotnet 8.0 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: "8.0.x" | |
- uses: actions/download-artifact@v3 | |
with: | |
name: nuget | |
path: ${{ env.NuGetDirectory }} | |
- name: Publish NuGet package | |
run: | | |
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { | |
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate | |
} |