From 3cc75deb09c33902fcd65054750f5716e4614e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 7 Sep 2022 20:04:00 +0200 Subject: [PATCH 1/8] Enabling package validation --- .github/actions/publish-nuget/action.yml | 9 ++++++--- .github/workflows/publish-nuget.yml | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/actions/publish-nuget/action.yml b/.github/actions/publish-nuget/action.yml index 7ede5a0af..51614da12 100644 --- a/.github/actions/publish-nuget/action.yml +++ b/.github/actions/publish-nuget/action.yml @@ -124,10 +124,12 @@ runs: # Notes on the configuration apart from what's also for dotnet build: # * NoWarn on NU5104 to not have warnings for prerelease dependencies, see: # https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu5104. - # * -p:WarnOnPackingNonPackableProject=True will cause a build warning (converted to error) if we try to pack - # a non-packagable project. + # * -p:WarnOnPackingNonPackableProject=True will cause a build warning (converted to error) if we try to pack a + # non-packagable project. # * -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg are needed to generate symbol packages: # https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg. + # * p:EnablePackageValidation=true is for package validation, see: + # https://docs.microsoft.com/en-us/dotnet/fundamentals/package-validation/overview. run: | if ([string]::IsNullOrWhiteSpace($Env:API_KEY)) { Write-Output "::error::API_KEY is missing or empty." @@ -154,7 +156,8 @@ runs: "-p:WarnOnPackingNonPackableProject=True", "-p:IncludeSymbols=${{ inputs.dotnet-pack-include-symbols }}", "-p:SymbolPackageFormat=snupkg", - "-p:NoDefaultExcludes=true" + "-p:NoDefaultExcludes=true", + "-p:EnablePackageValidation=true" ) - name: Push with dotnet diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 20203f200..48d0eb8a9 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -68,7 +68,7 @@ jobs: dotnet-version: ${{ inputs.dotnet-version }} - name: Publish to NuGet - uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@dev + uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@issue/OSOE-176 with: source: ${{ inputs.source }} verbosity: ${{ inputs.verbosity }} From 15cb94f24519248a455695bdda4367998babed6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 7 Sep 2022 20:04:43 +0200 Subject: [PATCH 2/8] Temporarily disabling publishing the packed NuGet package --- .github/actions/publish-nuget/action.yml | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/actions/publish-nuget/action.yml b/.github/actions/publish-nuget/action.yml index 51614da12..aa34d2246 100644 --- a/.github/actions/publish-nuget/action.yml +++ b/.github/actions/publish-nuget/action.yml @@ -160,24 +160,24 @@ runs: "-p:EnablePackageValidation=true" ) - - name: Push with dotnet - shell: pwsh - run: dotnet nuget push artifacts/*.nupkg --api-key $Env:API_KEY --source '${{ steps.setup.outputs.source-url }}' --skip-duplicate - - - name: Publish Artifacts - uses: actions/upload-artifact@v3 - with: - name: NuGet-Package - path: artifacts - - # This is not in its own action because it's all very specific to this NuGet publishing. - - name: Create Release - # v1.10.0 - uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37 - # This is to prevent creating releases when pushing tags for issue-specific pre-releases like - # v4.3.1-alpha.osoe-86. - if: "!contains(steps.setup.outputs.publish-version, '-')" - with: - allowUpdates: true - generateReleaseNotes: true - artifacts: artifacts/*.nupkg, artifacts/*.snupkg + #- name: Push with dotnet + # shell: pwsh + # run: dotnet nuget push artifacts/*.nupkg --api-key $Env:API_KEY --source '${{ steps.setup.outputs.source-url }}' --skip-duplicate + + #- name: Publish Artifacts + # uses: actions/upload-artifact@v3 + # with: + # name: NuGet-Package + # path: artifacts + + ## This is not in its own action because it's all very specific to this NuGet publishing. + #- name: Create Release + # # v1.10.0 + # uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37 + # # This is to prevent creating releases when pushing tags for issue-specific pre-releases like + # # v4.3.1-alpha.osoe-86. + # if: "!contains(steps.setup.outputs.publish-version, '-')" + # with: + # allowUpdates: true + # generateReleaseNotes: true + # artifacts: artifacts/*.nupkg, artifacts/*.snupkg From 3af8c6fddd05801b84efb9e84de68df6e75d7048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 8 Sep 2022 12:25:00 +0200 Subject: [PATCH 3/8] Revert commented out code --- .github/actions/publish-nuget/action.yml | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/actions/publish-nuget/action.yml b/.github/actions/publish-nuget/action.yml index aa34d2246..51614da12 100644 --- a/.github/actions/publish-nuget/action.yml +++ b/.github/actions/publish-nuget/action.yml @@ -160,24 +160,24 @@ runs: "-p:EnablePackageValidation=true" ) - #- name: Push with dotnet - # shell: pwsh - # run: dotnet nuget push artifacts/*.nupkg --api-key $Env:API_KEY --source '${{ steps.setup.outputs.source-url }}' --skip-duplicate - - #- name: Publish Artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: NuGet-Package - # path: artifacts - - ## This is not in its own action because it's all very specific to this NuGet publishing. - #- name: Create Release - # # v1.10.0 - # uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37 - # # This is to prevent creating releases when pushing tags for issue-specific pre-releases like - # # v4.3.1-alpha.osoe-86. - # if: "!contains(steps.setup.outputs.publish-version, '-')" - # with: - # allowUpdates: true - # generateReleaseNotes: true - # artifacts: artifacts/*.nupkg, artifacts/*.snupkg + - name: Push with dotnet + shell: pwsh + run: dotnet nuget push artifacts/*.nupkg --api-key $Env:API_KEY --source '${{ steps.setup.outputs.source-url }}' --skip-duplicate + + - name: Publish Artifacts + uses: actions/upload-artifact@v3 + with: + name: NuGet-Package + path: artifacts + + # This is not in its own action because it's all very specific to this NuGet publishing. + - name: Create Release + # v1.10.0 + uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37 + # This is to prevent creating releases when pushing tags for issue-specific pre-releases like + # v4.3.1-alpha.osoe-86. + if: "!contains(steps.setup.outputs.publish-version, '-')" + with: + allowUpdates: true + generateReleaseNotes: true + artifacts: artifacts/*.nupkg, artifacts/*.snupkg From 2fd1aad84abe1571b99c9be2a1e716e900bb9dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 8 Sep 2022 12:27:42 +0200 Subject: [PATCH 4/8] Revert "Revert commented out code" This reverts commit 3af8c6fddd05801b84efb9e84de68df6e75d7048. --- .github/actions/publish-nuget/action.yml | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/actions/publish-nuget/action.yml b/.github/actions/publish-nuget/action.yml index 51614da12..aa34d2246 100644 --- a/.github/actions/publish-nuget/action.yml +++ b/.github/actions/publish-nuget/action.yml @@ -160,24 +160,24 @@ runs: "-p:EnablePackageValidation=true" ) - - name: Push with dotnet - shell: pwsh - run: dotnet nuget push artifacts/*.nupkg --api-key $Env:API_KEY --source '${{ steps.setup.outputs.source-url }}' --skip-duplicate - - - name: Publish Artifacts - uses: actions/upload-artifact@v3 - with: - name: NuGet-Package - path: artifacts - - # This is not in its own action because it's all very specific to this NuGet publishing. - - name: Create Release - # v1.10.0 - uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37 - # This is to prevent creating releases when pushing tags for issue-specific pre-releases like - # v4.3.1-alpha.osoe-86. - if: "!contains(steps.setup.outputs.publish-version, '-')" - with: - allowUpdates: true - generateReleaseNotes: true - artifacts: artifacts/*.nupkg, artifacts/*.snupkg + #- name: Push with dotnet + # shell: pwsh + # run: dotnet nuget push artifacts/*.nupkg --api-key $Env:API_KEY --source '${{ steps.setup.outputs.source-url }}' --skip-duplicate + + #- name: Publish Artifacts + # uses: actions/upload-artifact@v3 + # with: + # name: NuGet-Package + # path: artifacts + + ## This is not in its own action because it's all very specific to this NuGet publishing. + #- name: Create Release + # # v1.10.0 + # uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37 + # # This is to prevent creating releases when pushing tags for issue-specific pre-releases like + # # v4.3.1-alpha.osoe-86. + # if: "!contains(steps.setup.outputs.publish-version, '-')" + # with: + # allowUpdates: true + # generateReleaseNotes: true + # artifacts: artifacts/*.nupkg, artifacts/*.snupkg From b73498db610ef7ef45e5a63aed85d0138f55bf5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 8 Sep 2022 12:29:40 +0200 Subject: [PATCH 5/8] NuGet pack needs build for package validation --- .github/actions/publish-nuget/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/publish-nuget/action.yml b/.github/actions/publish-nuget/action.yml index aa34d2246..608e5d6d8 100644 --- a/.github/actions/publish-nuget/action.yml +++ b/.github/actions/publish-nuget/action.yml @@ -144,7 +144,6 @@ runs: "--configuration:Release", "--warnaserror", "--no-restore", - "--no-build", "--output:" + (Join-Path $PWD artifacts), "--verbosity:${{ inputs.verbosity }}", "-p:NuGetBuild=true", From 15adaba8df498ee2111fd83401e41fc1ee7058c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 8 Sep 2022 12:53:54 +0200 Subject: [PATCH 6/8] Adding basic NoWarns to NuGet pack too --- .github/actions/publish-nuget/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/publish-nuget/action.yml b/.github/actions/publish-nuget/action.yml index 608e5d6d8..81f7b730f 100644 --- a/.github/actions/publish-nuget/action.yml +++ b/.github/actions/publish-nuget/action.yml @@ -136,7 +136,7 @@ runs: exit 1 } - $noWarn = @('NU5104') + @' + $noWarn = @('NU5104%3BCS1573%3BCS1591%3BVSTHRD002%3BVSTHRD200') + @' ${{ inputs.dotnet-pack-ignore-warning }} '@.Split() | ? { $_ } From 8ecb1094d3b43d2a71a4d36b9d06c1ae6da48cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 8 Sep 2022 13:09:04 +0200 Subject: [PATCH 7/8] Revert "Revert "Revert commented out code"" This reverts commit 2fd1aad84abe1571b99c9be2a1e716e900bb9dc7. --- .github/actions/publish-nuget/action.yml | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/actions/publish-nuget/action.yml b/.github/actions/publish-nuget/action.yml index 81f7b730f..e9f3969a1 100644 --- a/.github/actions/publish-nuget/action.yml +++ b/.github/actions/publish-nuget/action.yml @@ -159,24 +159,24 @@ runs: "-p:EnablePackageValidation=true" ) - #- name: Push with dotnet - # shell: pwsh - # run: dotnet nuget push artifacts/*.nupkg --api-key $Env:API_KEY --source '${{ steps.setup.outputs.source-url }}' --skip-duplicate - - #- name: Publish Artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: NuGet-Package - # path: artifacts - - ## This is not in its own action because it's all very specific to this NuGet publishing. - #- name: Create Release - # # v1.10.0 - # uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37 - # # This is to prevent creating releases when pushing tags for issue-specific pre-releases like - # # v4.3.1-alpha.osoe-86. - # if: "!contains(steps.setup.outputs.publish-version, '-')" - # with: - # allowUpdates: true - # generateReleaseNotes: true - # artifacts: artifacts/*.nupkg, artifacts/*.snupkg + - name: Push with dotnet + shell: pwsh + run: dotnet nuget push artifacts/*.nupkg --api-key $Env:API_KEY --source '${{ steps.setup.outputs.source-url }}' --skip-duplicate + + - name: Publish Artifacts + uses: actions/upload-artifact@v3 + with: + name: NuGet-Package + path: artifacts + + # This is not in its own action because it's all very specific to this NuGet publishing. + - name: Create Release + # v1.10.0 + uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37 + # This is to prevent creating releases when pushing tags for issue-specific pre-releases like + # v4.3.1-alpha.osoe-86. + if: "!contains(steps.setup.outputs.publish-version, '-')" + with: + allowUpdates: true + generateReleaseNotes: true + artifacts: artifacts/*.nupkg, artifacts/*.snupkg From b9d68399f7a6e91a8c00b6f4de947b537f7334f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Thu, 8 Sep 2022 21:48:34 +0200 Subject: [PATCH 8/8] Pointing to dev --- .github/workflows/publish-nuget.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 48d0eb8a9..20203f200 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -68,7 +68,7 @@ jobs: dotnet-version: ${{ inputs.dotnet-version }} - name: Publish to NuGet - uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@issue/OSOE-176 + uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@dev with: source: ${{ inputs.source }} verbosity: ${{ inputs.verbosity }}