From 6029d10d69a1c4f9c5acb0c5c389e2d04443941f Mon Sep 17 00:00:00 2001 From: AraHaan Date: Sun, 13 Jun 2021 22:46:45 -0400 Subject: [PATCH 1/3] Remove INCLUDE_SYMBOLS for project configured options. The options for these that can be set in msbuild props files / the csproj project file of the project that needs to be packed by the action would be honored by both ``dotnet pack`` and ``dotnet nuget push`` (the docs was not 100% clear on ``dotnet nuget push`` however but that is normal for Microsoft made docs). --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7f46d67..f91feaf 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,6 @@ jobs: # NuGet server uri hosting the packages, defaults to https://api.nuget.org # NUGET_SOURCE: https://api.nuget.org - - # Flag to toggle pushing symbols along with nuget package to the server, disabled by default - # INCLUDE_SYMBOLS: false ``` - Project gets published only if there's a `NUGET_KEY` configured in the repository @@ -73,7 +70,6 @@ TAG_COMMIT | `true` | Flag to toggle git tagging, enabled by default TAG_FORMAT | `v*` | Format of the git tag, `[*]` gets replaced with actual version NUGET_KEY | | API key to authenticate with NuGet server NUGET_SOURCE | `https://api.nuget.org` | NuGet server uri hosting the packages, defaults to https://api.nuget.org -INCLUDE_SYMBOLS | `false` | Flag to toggle pushing symbols along with nuget package to the server, disabled by default ## Outputs @@ -89,6 +85,9 @@ SYMBOLS_PACKAGE_PATH | Path to the generated symbols package - Outputs may or may not be set depending on the action inputs or if the action failed - `NUGET_SOURCE` must support `/v3-flatcontainer/PACKAGE_NAME/index.json` for version change detection to work - Multiple projects can make use of steps to configure each project individually, common inputs between steps can be given as `env` for [job / workflow](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#env) +- When wanting to include symbols in an symbols package set these as well in the csproj or an ``Directory.Build.props`` file of the project being packaged: + - ``true`` + - ``snupkg`` ## License [MIT](LICENSE) From f6e1b7491aa432ceac31e7675b97d31b3f300995 Mon Sep 17 00:00:00 2001 From: AraHaan Date: Sun, 13 Jun 2021 22:48:10 -0400 Subject: [PATCH 2/3] Remove INCLUDE_SYMBOLS. --- action.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 9dc71b2..bdfe22c 100644 --- a/action.yml +++ b/action.yml @@ -34,10 +34,6 @@ inputs: description: NuGet server uri hosting the packages, defaults to https://api.nuget.org required: false default: https://api.nuget.org - INCLUDE_SYMBOLS: - description: Flag to toggle pushing symbols along with nuget package to the server, disabled by default - required: false - default: false outputs: VERSION: @@ -61,4 +57,4 @@ runs: branding: icon: package - color: blue \ No newline at end of file + color: blue From c51436b867e7a2697b1f5b91a0ebfcab1b19ed5f Mon Sep 17 00:00:00 2001 From: AraHaan Date: Sun, 13 Jun 2021 22:53:11 -0400 Subject: [PATCH 3/3] Remove INCLUDE_SYMBOLS. --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index db47a6d..eb570a3 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,6 @@ class Action { this.tagFormat = process.env.INPUT_TAG_FORMAT || process.env.TAG_FORMAT this.nugetKey = process.env.INPUT_NUGET_KEY || process.env.NUGET_KEY this.nugetSource = process.env.INPUT_NUGET_SOURCE || process.env.NUGET_SOURCE - this.includeSymbols = JSON.parse(process.env.INPUT_INCLUDE_SYMBOLS || process.env.INCLUDE_SYMBOLS) } _printErrorAndExit(msg) { @@ -59,12 +58,12 @@ class Action { 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 --no-build -c Release ${this.projectFile} -o .`) 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`, pushOutput = this._executeCommand(pushCmd, { encoding: "utf-8" }).stdout console.log(pushOutput)