update package generation scripts #26
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 | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup dotnet 6.0.x | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "6.0.x" | |
- name: Setup dotnet 7.0.x | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "7.0.x" | |
- name: Setup dotnet 8.0.x | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "8.0.x" | |
- uses: nowsprinting/check-version-format-action@v3 | |
id: version | |
with: | |
prefix: 'v' | |
- uses: nuget/setup-nuget@v2 | |
- run: nuget restore NuGetUtility.sln | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: build | |
run: msbuild -t:rebuild -property:Configuration=Release | |
- name: test | |
uses: microsoft/[email protected] | |
with: | |
testAssembly: "NuGetUtility.Test.dll" | |
searchFolder: "tests/NuGetUtility.Test/bin/Release/net8.0/" | |
runInParallel: true | |
- name: Publish the application binaries (.net6) | |
run: msbuild ./src/NuGetUtility/NuGetUtility.csproj /t:Publish /p:configuration=Release /p:OutDir./artifacts/net6 /p:TargetFramework=net6.0 /p:Version=${{ steps.version.outputs.full_without_prefix }} | |
- name: Publish the application binaries (.net7) | |
run: msbuild ./src/NuGetUtility/NuGetUtility.csproj /t:Publish /p:configuration=Release /p:OutDir./artifacts/net7 /p:TargetFramework=net7.0 /p:Version=${{ steps.version.outputs.full_without_prefix }} | |
- name: Publish the application binaries (.net8) | |
run: msbuild ./src/NuGetUtility/NuGetUtility.csproj /t:Publish /p:configuration=Release /p:OutDir./artifacts/net8 /p:TargetFramework=net8.0 /p:Version=${{ steps.version.outputs.full_without_prefix }} | |
- name: Publish the application binaries (.net472) | |
run: msbuild ./src/NuGetUtility/NuGetUtility.csproj /t:Publish /p:configuration=Release /p:OutDir./artifacts/net472 /p:TargetFramework=net472 /p:Version=${{ steps.version.outputs.full_without_prefix }} | |
- name: Create nuget package | |
run: msbuild ./src/NuGetUtility/NuGetUtility.csproj /t:Pack /p:configuration=Release /p:OutDir./artifacts /p:Version=${{ steps.version.outputs.full_without_prefix }} | |
- name: Zip artifacts | |
uses: thedoctor0/[email protected] | |
with: | |
type: 'zip' | |
filename: 'release.zip' | |
path: ./artifacts | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
prerelease: ${{ steps.version.outputs.prerelease != '' }} | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
files: | | |
release.zip | |
- name: publish nuget package to nuget.org | |
id: publish_nuget | |
run: dotnet nuget push ./artifacts/*.nupkg -s 'https://api.nuget.org/v3/index.json' -k ${{secrets.NUGET_KEY}} --skip-duplicate |