From 27d5fff90bb63df7b2c21a884a38aff99fbfd450 Mon Sep 17 00:00:00 2001 From: Kurounin Date: Thu, 10 Mar 2022 19:25:34 +0200 Subject: [PATCH 1/2] fix: file not found error when using latest dotnet 6.0.2 Details in https://github.com/NuGet/Home/issues/11601#issuecomment-1054883488 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index ef55668..03f1b3a 100644 --- a/index.js +++ b/index.js @@ -64,7 +64,7 @@ class Action { const packages = fs.readdirSync(".").filter(fn => fn.endsWith("nupkg")) console.log(`Generated Package(s): ${packages.join(", ")}`) - const pushCmd = `dotnet nuget push *.nupkg -s ${this.nugetSource}/v3/index.json -k ${this.nugetKey} --skip-duplicate${!this.includeSymbols ? " -n 1" : ""}`, + const pushCmd = `dotnet nuget push *.nupkg -s ${this.nugetSource}/v3/index.json -k ${this.nugetKey} --skip-duplicate${!this.includeSymbols ? " -n" : ""}`, pushOutput = this._executeCommand(pushCmd, { encoding: "utf-8" }).stdout console.log(pushOutput) From 81690a8cd411224b53cd407ff6fd797ae1bde4d5 Mon Sep 17 00:00:00 2001 From: Kurounin Date: Thu, 10 Mar 2022 19:30:33 +0200 Subject: [PATCH 2/2] refactor: skip build step and allow pack to build the project to fix an issue when additional files would not be included in package --- index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/index.js b/index.js index 03f1b3a..2937eeb 100644 --- a/index.js +++ b/index.js @@ -57,9 +57,7 @@ class Action { fs.readdirSync(".").filter(fn => /\.s?nupkg$/.test(fn)).forEach(fn => fs.unlinkSync(fn)) - this._executeInProcess(`dotnet build -c Release ${this.projectFile}`) - - this._executeInProcess(`dotnet pack ${this.includeSymbols ? "--include-symbols -p:SymbolPackageFormat=snupkg" : ""} --no-build -c Release ${this.projectFile} -o .`) + this._executeInProcess(`dotnet pack ${this.includeSymbols ? "--include-symbols -p:SymbolPackageFormat=snupkg" : ""} -c Release ${this.projectFile} -o .`) const packages = fs.readdirSync(".").filter(fn => fn.endsWith("nupkg")) console.log(`Generated Package(s): ${packages.join(", ")}`)