Skip to content
This repository was archived by the owner on Oct 26, 2022. It is now read-only.

Commit d2ec0dc

Browse files
fix #30 & partially removed 2.4.0 changes due to bugs with nuget
1 parent 8aef0d6 commit d2ec0dc

File tree

3 files changed

+8
-28
lines changed

3 files changed

+8
-28
lines changed

README.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,11 @@ jobs:
5151
# API key to authenticate with NuGet server
5252
# NUGET_KEY: ${{secrets.NUGET_API_KEY}}
5353

54-
# API key to authenticate with NuGet symbols server, defaults to NUGET_KEY
55-
# NUGET_SYMBOL_KEY: ${{secrets.NUGET_SYMBOLS_API_KEY}}
56-
5754
# NuGet server uri hosting the packages, defaults to https://api.nuget.org
5855
# NUGET_SOURCE: https://api.nuget.org
5956

60-
# NuGet server uri hosting the symbols, defaults to https://api.nuget.org
61-
# NUGET_SYMBOL_SOURCE: https://api.nuget.org
62-
63-
# Flag to toggle pushing symbols along with nuget package to the server, enabled by default
64-
# INCLUDE_SYMBOLS: true
57+
# Flag to toggle pushing symbols along with nuget package to the server, disabled by default
58+
# INCLUDE_SYMBOLS: false
6559
```
6660

6761
- Project gets published only if there's a `NUGET_KEY` configured in the repository
@@ -78,10 +72,8 @@ VERSION_STATIC| | Useful with external providers like Nerdbank.GitVersioning, ig
7872
TAG_COMMIT | `true` | Flag to toggle git tagging, enabled by default
7973
TAG_FORMAT | `v*` | Format of the git tag, `[*]` gets replaced with actual version
8074
NUGET_KEY | | API key to authenticate with NuGet server
81-
NUGET_SYMBOL_KEY | `[NUGET_KEY]` | API key to authenticate with NuGet symbols server, defaults to NUGET_KEY
8275
NUGET_SOURCE | `https://api.nuget.org` | NuGet server uri hosting the packages, defaults to https://api.nuget.org
83-
NUGET_SYMBOL_SOURCE | `https://api.nuget.org` | NuGet server uri hosting the symbols, defaults to https://api.nuget.org
84-
INCLUDE_SYMBOLS | `true` | Flag to toggle pushing symbols along with nuget package to the server, enabled by default
76+
INCLUDE_SYMBOLS | `false` | Flag to toggle pushing symbols along with nuget package to the server, disabled by default
8577

8678
## Outputs
8779

@@ -94,7 +86,7 @@ SYMBOLS_PACKAGE_NAME | Name of the symbols package generated
9486
SYMBOLS_PACKAGE_PATH | Path to the generated symbols package
9587

9688
**FYI:**
97-
- Outputs may not be set if the action failed
89+
- Outputs may or may not be set depending on the action inputs or if the action failed
9890
- `NUGET_SOURCE` must support `/v3-flatcontainer/PACKAGE_NAME/index.json` for version change detection to work
9991
- 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)
10092

action.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,14 @@ inputs:
3030
NUGET_KEY:
3131
description: API key to authenticate with NuGet server
3232
required: false
33-
NUGET_SYMBOL_KEY:
34-
description: API key to authenticate with NuGet symbols server, defaults to NUGET_KEY
35-
required: false
3633
NUGET_SOURCE:
3734
description: NuGet server uri hosting the packages, defaults to https://api.nuget.org
3835
required: false
3936
default: https://api.nuget.org
40-
NUGET_SYMBOL_SOURCE:
41-
description: NuGet server uri hosting the symbols, defaults to https://api.nuget.org
42-
required: false
43-
default: https://api.nuget.org
4437
INCLUDE_SYMBOLS:
45-
description: Flag to toggle pushing symbols along with nuget package to the server, enabled by default
38+
description: Flag to toggle pushing symbols along with nuget package to the server, disabled by default
4639
required: false
47-
default: true
40+
default: false
4841

4942
outputs:
5043
VERSION:

index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ class Action {
1414
this.tagCommit = JSON.parse(process.env.INPUT_TAG_COMMIT || process.env.TAG_COMMIT)
1515
this.tagFormat = process.env.INPUT_TAG_FORMAT || process.env.TAG_FORMAT
1616
this.nugetKey = process.env.INPUT_NUGET_KEY || process.env.NUGET_KEY
17-
this.nugetSymbolKey = process.env.INPUT_NUGET_SYMBOL_KEY || process.env.NUGET_SYMBOL_KEY || this.nugetKey
1817
this.nugetSource = process.env.INPUT_NUGET_SOURCE || process.env.NUGET_SOURCE
19-
this.nugetSymbolSource = process.env.INPUT_NUGET_SYMBOL_SOURCE || process.env.NUGET_SYMBOL_SOURCE
2018
this.includeSymbols = JSON.parse(process.env.INPUT_INCLUDE_SYMBOLS || process.env.INCLUDE_SYMBOLS)
2119
}
2220

@@ -56,20 +54,17 @@ class Action {
5654
}
5755

5856
console.log(`NuGet Source: ${this.nugetSource}`)
59-
console.log(`NuGet Symbol Source: ${this.nugetSymbolSource}`)
6057

6158
fs.readdirSync(".").filter(fn => fn.endsWith("nupkg")).forEach(fn => fs.unlinkSync(fn))
6259

6360
this._executeInProcess(`dotnet build -c Release ${this.projectFile}`)
6461

65-
const packSymbolFlags = this.includeSymbols ? "--include-symbols -p:SymbolPackageFormat=snupkg" : ""
66-
this._executeInProcess(`dotnet pack ${packSymbolFlags} --no-build -c Release ${this.projectFile} -o .`)
62+
this._executeInProcess(`dotnet pack ${this.includeSymbols ? "--include-symbols -p:SymbolPackageFormat=snupkg" : ""} --no-build -c Release ${this.projectFile} -o .`)
6763

6864
const packages = fs.readdirSync(".").filter(fn => fn.endsWith("nupkg"))
6965
console.log(`Generated Package(s): ${packages.join(", ")}`)
7066

71-
const pushSymbolFlags = this.includeSymbols ? `-ss ${this.nugetSymbolSource}/v3/index.json -sk ${this.nugetSymbolKey}` : "--no-symbols",
72-
pushCmd = `dotnet nuget push *.nupkg -s ${this.nugetSource}/v3/index.json -k ${this.nugetKey} ${pushSymbolFlags} --skip-duplicate`,
67+
const pushCmd = `dotnet nuget push *.nupkg -s ${this.nugetSource}/v3/index.json -k ${this.nugetKey} ${!this.includeSymbols ? "--no-symbols" : ""} --skip-duplicate`,
7368
pushOutput = this._executeCommand(pushCmd, { encoding: "utf-8" }).stdout
7469

7570
console.log(pushOutput)

0 commit comments

Comments
 (0)