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) 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 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)