Skip to content

reenable license url verification (#40) #41

reenable license url verification (#40)

reenable license url verification (#40) #41

Workflow file for this run

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
- uses: browser-actions/setup-chrome@latest
- name: test
uses: microsoft/[email protected]
with:
testAssembly: "NuGetUtility.Test.dll"
searchFolder: "tests/NuGetUtility.Test/bin/Release/net8.0/"
runInParallel: true
- name: fully qualify artifacts path
id: artifacts_path
shell: pwsh
run: |
$path = [System.IO.Path]::GetFullPath("./artifacts");
echo "publish to path: $path"
echo "path=$path" >> $env:GITHUB_OUTPUT
- name: Publish the application binaries (.net6)
run: dotnet publish ./src/NuGetLicenseCore/NuGetLicenseCore.csproj -c Release --no-restore -o ${{ steps.artifacts_path.outputs.path }}/net6 -f net6.0 -p:Version=${{ steps.version.outputs.full_without_prefix }}
- name: Publish the application binaries (.net7)
run: dotnet publish ./src/NuGetLicenseCore/NuGetLicenseCore.csproj -c Release --no-restore -o ${{ steps.artifacts_path.outputs.path }}/net7 -f net7.0 -p:Version=${{ steps.version.outputs.full_without_prefix }}
- name: Publish the application binaries (.net8)
run: dotnet publish ./src/NuGetLicenseCore/NuGetLicenseCore.csproj -c Release --no-restore -o ${{ steps.artifacts_path.outputs.path }}/net8 -f net8.0 -p:Version=${{ steps.version.outputs.full_without_prefix }}
- name: Publish the application binaries (.net472)
run: msbuild ./src/NuGetLicenseFramework/NuGetLicenseFramework.csproj /t:Publish /p:configuration=Release /p:PublishDir=${{ steps.artifacts_path.outputs.path }}/net472 /p:Version=${{ steps.version.outputs.full_without_prefix }}
- name: Create nuget package
run: dotnet pack ./src/NuGetLicenseCore/NuGetLicenseCore.csproj -c Release --no-build -o ${{ steps.artifacts_path.outputs.path }} -p:Version=${{ steps.version.outputs.full_without_prefix }}
- name: Zip artifacts
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: 'release.zip'
path: ${{ steps.artifacts_path.outputs.path }}
- 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
shell: pwsh
run: |
Get-ChildItem -Path ${{ steps.artifacts_path.outputs.path }} -Include *.nupkg | Select-Object -ExpandProperty FullName | foreach { dotnet nuget push "$_" -s 'https://api.nuget.org/v3/index.json' -k ${{ secrets.NUGET_KEY }} --skip-duplicate }