You've already forked setup-dotnet
mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-07-14 02:50:31 +07:00
Compare commits
29 Commits
Author | SHA1 | Date | |
---|---|---|---|
607fce577a | |||
501b34e8f6 | |||
b827fcce4d | |||
239baf3c5b | |||
4d4a70f4a5 | |||
70c3f4d098 | |||
9260643816 | |||
45c9f236cf | |||
6d6c7c9313 | |||
e753bbf2ff | |||
629365b26e | |||
942a0bea39 | |||
26db2473e9 | |||
467621733d | |||
bdd38d13dc | |||
1d2f8f9eaf | |||
354d280fa3 | |||
0ff311b0d0 | |||
bc65ba63d3 | |||
90642fa8c5 | |||
cf081e76a2 | |||
4ca3c96b49 | |||
cc76dfab99 | |||
1f2c90bb99 | |||
251997c37d | |||
5d7bc0454b | |||
792e988dae | |||
e5034212c9 | |||
0997db20d4 |
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1 +1 @@
|
|||||||
.licenses/** -diff linguist-generated=true
|
.licenses/** -diff linguist-generated=true
|
||||||
|
2
.licenses/npm/@actions/core.dep.yml
generated
2
.licenses/npm/@actions/core.dep.yml
generated
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/core"
|
name: "@actions/core"
|
||||||
version: 1.9.1
|
version: 1.10.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions core lib
|
summary: Actions core lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/core
|
homepage: https://github.com/actions/toolkit/tree/main/packages/core
|
||||||
|
22
.licenses/npm/fast-xml-parser.dep.yml
generated
22
.licenses/npm/fast-xml-parser.dep.yml
generated
@ -1,27 +1,11 @@
|
|||||||
---
|
---
|
||||||
name: fast-xml-parser
|
name: fast-xml-parser
|
||||||
version: 3.17.4
|
version: 4.0.10
|
||||||
type: npm
|
type: npm
|
||||||
summary: Validate XML or Parse XML to JS/JSON very fast without C/C++ based libraries
|
summary: Validate XML, Parse XML to JS Object, or Build XML from JS Object without C/C++ based libraries and no callback.
|
||||||
homepage: https://github.com/NaturalIntelligence/fast-xml-parser#readme
|
homepage: https://github.com/NaturalIntelligence/fast-xml-parser#readme
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
text: "MIT License\n\nCopyright (c) 2017 Amit Kumar Gupta\n\nPermission is hereby
|
text: "MIT License\n\nCopyright (c) 2017 Amit Kumar Gupta\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
|
||||||
granted, free of charge, to any person obtaining a copy\nof this software and
|
|
||||||
associated documentation files (the \"Software\"), to deal\nin the Software without
|
|
||||||
restriction, including without limitation the rights\nto use, copy, modify, merge,
|
|
||||||
publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit
|
|
||||||
persons to whom the Software is\nfurnished to do so, subject to the following
|
|
||||||
conditions:\n\nIf you use this library in a public repository then you give us
|
|
||||||
the right to mention your company name and logo in user's list without further
|
|
||||||
permission required, but you can request them to be taken down within 30 days.
|
|
||||||
\n\nThe above copyright notice and this permission notice shall be included in
|
|
||||||
all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED
|
|
||||||
\"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT
|
|
||||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
|
||||||
FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
|
||||||
THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
|
|
||||||
notices: []
|
notices: []
|
||||||
|
11
.licenses/npm/strnum.dep.yml
generated
Normal file
11
.licenses/npm/strnum.dep.yml
generated
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
name: strnum
|
||||||
|
version: 1.0.5
|
||||||
|
type: npm
|
||||||
|
summary: Parse string into Number based on configuration
|
||||||
|
homepage: https://github.com/NaturalIntelligence/strnum
|
||||||
|
license: mit
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE
|
||||||
|
text: "MIT License\n\nCopyright (c) 2021 Natural Intelligence\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
|
||||||
|
notices: []
|
24
.licenses/npm/xmlbuilder.dep.yml
generated
24
.licenses/npm/xmlbuilder.dep.yml
generated
@ -1,24 +0,0 @@
|
|||||||
---
|
|
||||||
name: xmlbuilder
|
|
||||||
version: 13.0.2
|
|
||||||
type: npm
|
|
||||||
summary: An XML builder for node.js
|
|
||||||
homepage: http://github.com/oozcitak/xmlbuilder-js
|
|
||||||
license: mit
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: "The MIT License (MIT)\r\n\r\nCopyright (c) 2013 Ozgur Ozcitak\r\n\r\nPermission
|
|
||||||
is hereby granted, free of charge, to any person obtaining a copy\r\nof this software
|
|
||||||
and associated documentation files (the \"Software\"), to deal\r\nin the Software
|
|
||||||
without restriction, including without limitation the rights\r\nto use, copy,
|
|
||||||
modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software,
|
|
||||||
and to permit persons to whom the Software is\r\nfurnished to do so, subject to
|
|
||||||
the following conditions:\r\n\r\nThe above copyright notice and this permission
|
|
||||||
notice shall be included in\r\nall copies or substantial portions of the Software.\r\n\r\nTHE
|
|
||||||
SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED,
|
|
||||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR
|
|
||||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER
|
|
||||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION
|
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\nTHE SOFTWARE.\r\n"
|
|
||||||
notices: []
|
|
@ -7,5 +7,6 @@
|
|||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
"bracketSpacing": false,
|
"bracketSpacing": false,
|
||||||
"arrowParens": "avoid",
|
"arrowParens": "avoid",
|
||||||
"parser": "typescript"
|
"parser": "typescript",
|
||||||
|
"endOfLine": "auto"
|
||||||
}
|
}
|
10
README.md
10
README.md
@ -195,16 +195,24 @@ Some environment variables may be necessary for your particular case or to impro
|
|||||||
|
|
||||||
| **Env.variable** | **Description** | **Default value** |
|
| **Env.variable** | **Description** | **Default value** |
|
||||||
| ----------- | ----------- | ----------- |
|
| ----------- | ----------- | ----------- |
|
||||||
|
| DOTNET_INSTALL_DIR |Specifies a directory where .NET SDKs should be installed by the action.|*default value for each OS* |
|
||||||
| DOTNET_NOLOGO |Removes logo and telemetry message from first run of dotnet cli|*false*|
|
| DOTNET_NOLOGO |Removes logo and telemetry message from first run of dotnet cli|*false*|
|
||||||
| DOTNET_CLI_TELEMETRY_OPTOUT |Opt-out of telemetry being sent to Microsoft|*false*|
|
| DOTNET_CLI_TELEMETRY_OPTOUT |Opt-out of telemetry being sent to Microsoft|*false*|
|
||||||
| DOTNET_MULTILEVEL_LOOKUP |Configures whether the global install location is used as a fall-back|*true*|
|
| DOTNET_MULTILEVEL_LOOKUP |Configures whether the global install location is used as a fall-back|*true*|
|
||||||
|
|
||||||
|
The default value of the `DOTNET_INSTALL_DIR` environment variable depends on the operation system which is used on a runner:
|
||||||
|
| **Operation system** | **Default value** |
|
||||||
|
| ----------- | ----------- |
|
||||||
|
| **Windows** | `C:\Program Files\dotnet` |
|
||||||
|
| **Ubuntu** | `/usr/share/dotnet` |
|
||||||
|
| **macOS** | `/Users/runner/.dotnet` |
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
```yml
|
```yml
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
DOTNET_NOLOGO: true
|
DOTNET_INSTALL_DIR: "path/to/directory"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@main
|
- uses: actions/checkout@main
|
||||||
- uses: actions/setup-dotnet@v3
|
- uses: actions/setup-dotnet@v3
|
||||||
|
@ -5,11 +5,7 @@ import path from 'path';
|
|||||||
const fakeSourcesDirForTesting = path.join(
|
const fakeSourcesDirForTesting = path.join(
|
||||||
__dirname,
|
__dirname,
|
||||||
'runner',
|
'runner',
|
||||||
path.join(
|
path.join(Math.random().toString(36).substring(7)),
|
||||||
Math.random()
|
|
||||||
.toString(36)
|
|
||||||
.substring(7)
|
|
||||||
),
|
|
||||||
's'
|
's'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
8607
dist/index.js
vendored
8607
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
100
package-lock.json
generated
100
package-lock.json
generated
@ -1,22 +1,21 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-dotnet",
|
"name": "setup-dotnet",
|
||||||
"version": "3.0.0",
|
"version": "3.0.2",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "setup-dotnet",
|
"name": "setup-dotnet",
|
||||||
"version": "3.0.0",
|
"version": "3.0.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.9.1",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.0.4",
|
"@actions/exec": "^1.0.4",
|
||||||
"@actions/github": "^1.1.0",
|
"@actions/github": "^1.1.0",
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"@actions/io": "^1.0.2",
|
"@actions/io": "^1.0.2",
|
||||||
"fast-xml-parser": "^3.15.1",
|
"fast-xml-parser": "^4.0.10",
|
||||||
"semver": "^6.3.0",
|
"semver": "^6.3.0"
|
||||||
"xmlbuilder": "^13.0.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.0.2",
|
"@types/jest": "^27.0.2",
|
||||||
@ -26,16 +25,16 @@
|
|||||||
"husky": "^8.0.1",
|
"husky": "^8.0.1",
|
||||||
"jest": "^27.2.5",
|
"jest": "^27.2.5",
|
||||||
"jest-circus": "^27.2.5",
|
"jest-circus": "^27.2.5",
|
||||||
"prettier": "^1.19.1",
|
"prettier": "^2.7.1",
|
||||||
"ts-jest": "^27.0.5",
|
"ts-jest": "^27.0.5",
|
||||||
"typescript": "^3.9.7",
|
"typescript": "^4.8.4",
|
||||||
"wget-improved": "^3.2.1"
|
"wget-improved": "^3.2.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
"version": "1.9.1",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
||||||
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
|
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"uuid": "^8.3.2"
|
"uuid": "^8.3.2"
|
||||||
@ -1992,12 +1991,14 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/fast-xml-parser": {
|
"node_modules/fast-xml-parser": {
|
||||||
"version": "3.17.4",
|
"version": "4.0.10",
|
||||||
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-3.17.4.tgz",
|
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.10.tgz",
|
||||||
"integrity": "sha512-qudnQuyYBgnvzf5Lj/yxMcf4L9NcVWihXJg7CiU1L+oUCq8MUnFEfH2/nXR/W5uq+yvUN1h7z6s7vs2v1WkL1A==",
|
"integrity": "sha512-mYMMIk7Ho1QOiedyvafdyPamn1Vlda+5n95lcn0g79UiCQoLQ2xfPQ8m3pcxBMpVaftYXtoIE2wrNTjmLQnnkg==",
|
||||||
"hasInstallScript": true,
|
"dependencies": {
|
||||||
|
"strnum": "^1.0.5"
|
||||||
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"xml2js": "cli.js"
|
"fxparser": "src/cli/cli.js"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "paypal",
|
"type": "paypal",
|
||||||
@ -3883,15 +3884,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/prettier": {
|
"node_modules/prettier": {
|
||||||
"version": "1.19.1",
|
"version": "2.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
|
||||||
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
|
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"prettier": "bin-prettier.js"
|
"prettier": "bin-prettier.js"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4"
|
"node": ">=10.13.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/pretty-format": {
|
"node_modules/pretty-format": {
|
||||||
@ -4204,6 +4208,11 @@
|
|||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/strnum": {
|
||||||
|
"version": "1.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz",
|
||||||
|
"integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA=="
|
||||||
|
},
|
||||||
"node_modules/supports-color": {
|
"node_modules/supports-color": {
|
||||||
"version": "7.1.0",
|
"version": "7.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
|
||||||
@ -4430,9 +4439,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "3.9.7",
|
"version": "4.8.4",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
|
||||||
"integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==",
|
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
@ -4666,14 +4675,6 @@
|
|||||||
"integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==",
|
"integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/xmlbuilder": {
|
|
||||||
"version": "13.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-13.0.2.tgz",
|
|
||||||
"integrity": "sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/xmlchars": {
|
"node_modules/xmlchars": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
|
||||||
@ -4725,9 +4726,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": {
|
"@actions/core": {
|
||||||
"version": "1.9.1",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
||||||
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
|
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"uuid": "^8.3.2"
|
"uuid": "^8.3.2"
|
||||||
@ -6293,9 +6294,12 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"fast-xml-parser": {
|
"fast-xml-parser": {
|
||||||
"version": "3.17.4",
|
"version": "4.0.10",
|
||||||
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-3.17.4.tgz",
|
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.10.tgz",
|
||||||
"integrity": "sha512-qudnQuyYBgnvzf5Lj/yxMcf4L9NcVWihXJg7CiU1L+oUCq8MUnFEfH2/nXR/W5uq+yvUN1h7z6s7vs2v1WkL1A=="
|
"integrity": "sha512-mYMMIk7Ho1QOiedyvafdyPamn1Vlda+5n95lcn0g79UiCQoLQ2xfPQ8m3pcxBMpVaftYXtoIE2wrNTjmLQnnkg==",
|
||||||
|
"requires": {
|
||||||
|
"strnum": "^1.0.5"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"fb-watchman": {
|
"fb-watchman": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
@ -7723,9 +7727,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"version": "1.19.1",
|
"version": "2.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
|
||||||
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
|
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"pretty-format": {
|
"pretty-format": {
|
||||||
@ -7967,6 +7971,11 @@
|
|||||||
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
|
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"strnum": {
|
||||||
|
"version": "1.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz",
|
||||||
|
"integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA=="
|
||||||
|
},
|
||||||
"supports-color": {
|
"supports-color": {
|
||||||
"version": "7.1.0",
|
"version": "7.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
|
||||||
@ -8123,9 +8132,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "3.9.7",
|
"version": "4.8.4",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
|
||||||
"integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==",
|
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"universal-user-agent": {
|
"universal-user-agent": {
|
||||||
@ -8298,11 +8307,6 @@
|
|||||||
"integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==",
|
"integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"xmlbuilder": {
|
|
||||||
"version": "13.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-13.0.2.tgz",
|
|
||||||
"integrity": "sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ=="
|
|
||||||
},
|
|
||||||
"xmlchars": {
|
"xmlchars": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
|
||||||
|
13
package.json
13
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-dotnet",
|
"name": "setup-dotnet",
|
||||||
"version": "3.0.0",
|
"version": "3.0.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "setup dotnet action",
|
"description": "setup dotnet action",
|
||||||
"main": "lib/setup-dotnet.js",
|
"main": "lib/setup-dotnet.js",
|
||||||
@ -24,14 +24,13 @@
|
|||||||
"author": "GitHub",
|
"author": "GitHub",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.9.1",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.0.4",
|
"@actions/exec": "^1.0.4",
|
||||||
"@actions/github": "^1.1.0",
|
"@actions/github": "^1.1.0",
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"@actions/io": "^1.0.2",
|
"@actions/io": "^1.0.2",
|
||||||
"fast-xml-parser": "^3.15.1",
|
"fast-xml-parser": "^4.0.10",
|
||||||
"semver": "^6.3.0",
|
"semver": "^6.3.0"
|
||||||
"xmlbuilder": "^13.0.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.0.2",
|
"@types/jest": "^27.0.2",
|
||||||
@ -41,9 +40,9 @@
|
|||||||
"husky": "^8.0.1",
|
"husky": "^8.0.1",
|
||||||
"jest": "^27.2.5",
|
"jest": "^27.2.5",
|
||||||
"jest-circus": "^27.2.5",
|
"jest-circus": "^27.2.5",
|
||||||
"prettier": "^1.19.1",
|
"prettier": "^2.7.1",
|
||||||
"ts-jest": "^27.0.5",
|
"ts-jest": "^27.0.5",
|
||||||
"typescript": "^3.9.7",
|
"typescript": "^4.8.4",
|
||||||
"wget-improved": "^3.2.1"
|
"wget-improved": "^3.2.1"
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
|
160
src/authutil.ts
160
src/authutil.ts
@ -2,8 +2,7 @@ import * as fs from 'fs';
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as github from '@actions/github';
|
import * as github from '@actions/github';
|
||||||
import * as xmlbuilder from 'xmlbuilder';
|
import {XMLParser, XMLBuilder} from 'fast-xml-parser';
|
||||||
import * as xmlParser from 'fast-xml-parser';
|
|
||||||
|
|
||||||
export function configAuthentication(
|
export function configAuthentication(
|
||||||
feedUrl: string,
|
feedUrl: string,
|
||||||
@ -49,7 +48,6 @@ function writeFeedToFile(
|
|||||||
core.info(
|
core.info(
|
||||||
`dotnet-auth: Finding any source references in ${existingFileLocation}, writing a new temporary configuration file with credentials to ${tempFileLocation}`
|
`dotnet-auth: Finding any source references in ${existingFileLocation}, writing a new temporary configuration file with credentials to ${tempFileLocation}`
|
||||||
);
|
);
|
||||||
let xml: xmlbuilder.XMLElement;
|
|
||||||
let sourceKeys: string[] = [];
|
let sourceKeys: string[] = [];
|
||||||
let owner: string = core.getInput('owner');
|
let owner: string = core.getInput('owner');
|
||||||
let sourceUrl: string = feedUrl;
|
let sourceUrl: string = feedUrl;
|
||||||
@ -66,64 +64,90 @@ function writeFeedToFile(
|
|||||||
if (fs.existsSync(existingFileLocation)) {
|
if (fs.existsSync(existingFileLocation)) {
|
||||||
// get key from existing NuGet.config so NuGet/dotnet can match credentials
|
// get key from existing NuGet.config so NuGet/dotnet can match credentials
|
||||||
const curContents: string = fs.readFileSync(existingFileLocation, 'utf8');
|
const curContents: string = fs.readFileSync(existingFileLocation, 'utf8');
|
||||||
const json = xmlParser.parse(curContents, {ignoreAttributes: false});
|
|
||||||
|
const parserOptions = {
|
||||||
|
ignoreAttributes: false
|
||||||
|
};
|
||||||
|
const parser = new XMLParser(parserOptions);
|
||||||
|
const json = parser.parse(curContents);
|
||||||
|
|
||||||
if (typeof json.configuration === 'undefined') {
|
if (typeof json.configuration === 'undefined') {
|
||||||
throw new Error(`The provided NuGet.config seems invalid.`);
|
throw new Error(`The provided NuGet.config seems invalid.`);
|
||||||
}
|
}
|
||||||
if (typeof json.configuration.packageSources != 'undefined') {
|
if (json.configuration?.packageSources?.add) {
|
||||||
if (typeof json.configuration.packageSources.add != 'undefined') {
|
const packageSources = json.configuration.packageSources.add;
|
||||||
// file has at least one <add>
|
|
||||||
if (typeof json.configuration.packageSources.add[0] === 'undefined') {
|
if (Array.isArray(packageSources)) {
|
||||||
// file has only one <add>
|
packageSources.forEach(source => {
|
||||||
if (
|
const value = source['@_value'];
|
||||||
json.configuration.packageSources.add['@_value']
|
core.debug(`source '${value}'`);
|
||||||
.toLowerCase()
|
if (value.toLowerCase().includes(feedUrl.toLowerCase())) {
|
||||||
.includes(feedUrl.toLowerCase())
|
const key = source['@_key'];
|
||||||
) {
|
|
||||||
const key = json.configuration.packageSources.add['@_key'];
|
|
||||||
sourceKeys.push(key);
|
sourceKeys.push(key);
|
||||||
core.debug(`Found a URL with key ${key}`);
|
core.debug(`Found a URL with key ${key}`);
|
||||||
}
|
}
|
||||||
} else {
|
});
|
||||||
// file has 2+ <add>
|
} else {
|
||||||
for (
|
if (
|
||||||
let i = 0;
|
packageSources['@_value']
|
||||||
i < json.configuration.packageSources.add.length;
|
.toLowerCase()
|
||||||
i++
|
.includes(feedUrl.toLowerCase())
|
||||||
) {
|
) {
|
||||||
const source = json.configuration.packageSources.add[i];
|
const key = packageSources['@_key'];
|
||||||
const value = source['@_value'];
|
sourceKeys.push(key);
|
||||||
core.debug(`source '${value}'`);
|
core.debug(`Found a URL with key ${key}`);
|
||||||
if (value.toLowerCase().includes(feedUrl.toLowerCase())) {
|
|
||||||
const key = source['@_key'];
|
|
||||||
sourceKeys.push(key);
|
|
||||||
core.debug(`Found a URL with key ${key}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xml = xmlbuilder
|
const xmlSource: any[] = [
|
||||||
.create('configuration')
|
{
|
||||||
.ele('config')
|
'?xml': [
|
||||||
.ele('add', {key: 'defaultPushSource', value: sourceUrl})
|
{
|
||||||
.up()
|
'#text': ''
|
||||||
.up();
|
}
|
||||||
|
],
|
||||||
|
':@': {
|
||||||
|
'@_version': '1.0'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
configuration: [
|
||||||
|
{
|
||||||
|
config: [
|
||||||
|
{
|
||||||
|
add: [],
|
||||||
|
':@': {
|
||||||
|
'@_key': 'defaultPushSource',
|
||||||
|
'@_value': sourceUrl
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
if (!sourceKeys.length) {
|
if (!sourceKeys.length) {
|
||||||
let keystring = 'Source';
|
let keystring = 'Source';
|
||||||
xml = xml
|
|
||||||
.ele('packageSources')
|
xmlSource[1].configuration.push({
|
||||||
.ele('add', {key: keystring, value: sourceUrl})
|
packageSources: [
|
||||||
.up()
|
{
|
||||||
.up();
|
add: [],
|
||||||
|
':@': {
|
||||||
|
'@_key': keystring,
|
||||||
|
'@_value': sourceUrl
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
sourceKeys.push(keystring);
|
sourceKeys.push(keystring);
|
||||||
}
|
}
|
||||||
xml = xml.ele('packageSourceCredentials');
|
|
||||||
|
|
||||||
|
const packageSourceCredentials: any[] = [];
|
||||||
sourceKeys.forEach(key => {
|
sourceKeys.forEach(key => {
|
||||||
if (!isValidKey(key)) {
|
if (!isValidKey(key)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@ -131,24 +155,42 @@ function writeFeedToFile(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
xml = xml
|
packageSourceCredentials.push({
|
||||||
.ele(key)
|
[key]: [
|
||||||
.ele('add', {key: 'Username', value: owner})
|
{
|
||||||
.up()
|
add: [],
|
||||||
.ele('add', {
|
':@': {
|
||||||
key: 'ClearTextPassword',
|
'@_key': 'Username',
|
||||||
value: process.env.NUGET_AUTH_TOKEN
|
'@_value': owner
|
||||||
})
|
}
|
||||||
.up()
|
},
|
||||||
.up();
|
{
|
||||||
|
add: [],
|
||||||
|
':@': {
|
||||||
|
'@_key': 'ClearTextPassword',
|
||||||
|
'@_value': process.env.NUGET_AUTH_TOKEN
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// If NuGet fixes itself such that on Linux it can look for environment variables in the config file (it doesn't seem to work today),
|
xmlSource[1].configuration.push({
|
||||||
// use this for the value above
|
packageSourceCredentials
|
||||||
// process.platform == 'win32'
|
});
|
||||||
// ? '%NUGET_AUTH_TOKEN%'
|
|
||||||
// : '$NUGET_AUTH_TOKEN'
|
const xmlBuilderOptions = {
|
||||||
|
format: true,
|
||||||
|
ignoreAttributes: false,
|
||||||
|
preserveOrder: true,
|
||||||
|
allowBooleanAttributes: true,
|
||||||
|
suppressBooleanAttributes: true,
|
||||||
|
suppressEmptyNode: true
|
||||||
|
};
|
||||||
|
|
||||||
|
const builder = new XMLBuilder(xmlBuilderOptions);
|
||||||
|
|
||||||
|
const output = builder.build(xmlSource).trim();
|
||||||
|
|
||||||
const output = xml.end({pretty: true});
|
|
||||||
fs.writeFileSync(tempFileLocation, output);
|
fs.writeFileSync(tempFileLocation, output);
|
||||||
}
|
}
|
||||||
|
108
src/installer.ts
108
src/installer.ts
@ -6,8 +6,9 @@ import * as hc from '@actions/http-client';
|
|||||||
import {chmodSync} from 'fs';
|
import {chmodSync} from 'fs';
|
||||||
import {readdir} from 'fs/promises';
|
import {readdir} from 'fs/promises';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import os from 'os';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
import {IS_LINUX, IS_WINDOWS, IS_MAC} from './utils';
|
import {IS_LINUX, IS_WINDOWS} from './utils';
|
||||||
import {QualityOptions} from './setup-dotnet';
|
import {QualityOptions} from './setup-dotnet';
|
||||||
|
|
||||||
export interface DotnetVersion {
|
export interface DotnetVersion {
|
||||||
@ -106,46 +107,35 @@ export class DotnetVersionResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static DotNetCoreIndexUrl: string =
|
static DotNetCoreIndexUrl: string =
|
||||||
'https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json';
|
'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json';
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DotnetCoreInstaller {
|
export class DotnetCoreInstaller {
|
||||||
private version: string;
|
private version: string;
|
||||||
private quality: QualityOptions;
|
private quality: QualityOptions;
|
||||||
private static readonly installationDirectoryWindows = path.join(
|
|
||||||
process.env['PROGRAMFILES'] + '',
|
|
||||||
'dotnet'
|
|
||||||
);
|
|
||||||
private static readonly installationDirectoryLinux = '/usr/share/dotnet';
|
|
||||||
private static readonly installationDirectoryMac = path.join(
|
|
||||||
process.env['HOME'] + '',
|
|
||||||
'.dotnet'
|
|
||||||
);
|
|
||||||
|
|
||||||
static addToPath() {
|
static {
|
||||||
if (process.env['DOTNET_INSTALL_DIR']) {
|
const installationDirectoryWindows = path.join(
|
||||||
core.addPath(process.env['DOTNET_INSTALL_DIR']);
|
process.env['PROGRAMFILES'] + '',
|
||||||
core.exportVariable('DOTNET_ROOT', process.env['DOTNET_INSTALL_DIR']);
|
'dotnet'
|
||||||
|
);
|
||||||
|
const installationDirectoryLinux = '/usr/share/dotnet';
|
||||||
|
const installationDirectoryMac = path.join(
|
||||||
|
process.env['HOME'] + '',
|
||||||
|
'.dotnet'
|
||||||
|
);
|
||||||
|
const dotnetInstallDir: string | undefined =
|
||||||
|
process.env['DOTNET_INSTALL_DIR'];
|
||||||
|
if (dotnetInstallDir) {
|
||||||
|
process.env['DOTNET_INSTALL_DIR'] =
|
||||||
|
this.convertInstallPathToAbsolute(dotnetInstallDir);
|
||||||
} else {
|
} else {
|
||||||
if (IS_WINDOWS) {
|
if (IS_WINDOWS) {
|
||||||
core.addPath(DotnetCoreInstaller.installationDirectoryWindows);
|
process.env['DOTNET_INSTALL_DIR'] = installationDirectoryWindows;
|
||||||
core.exportVariable(
|
|
||||||
'DOTNET_ROOT',
|
|
||||||
DotnetCoreInstaller.installationDirectoryWindows
|
|
||||||
);
|
|
||||||
} else if (IS_LINUX) {
|
|
||||||
core.addPath(DotnetCoreInstaller.installationDirectoryLinux);
|
|
||||||
core.exportVariable(
|
|
||||||
'DOTNET_ROOT',
|
|
||||||
DotnetCoreInstaller.installationDirectoryLinux
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
// This is the default set in install-dotnet.sh
|
process.env['DOTNET_INSTALL_DIR'] = IS_LINUX
|
||||||
core.addPath(DotnetCoreInstaller.installationDirectoryMac);
|
? installationDirectoryLinux
|
||||||
core.exportVariable(
|
: installationDirectoryMac;
|
||||||
'DOTNET_ROOT',
|
|
||||||
DotnetCoreInstaller.installationDirectoryMac
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -155,6 +145,23 @@ export class DotnetCoreInstaller {
|
|||||||
this.quality = quality;
|
this.quality = quality;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static convertInstallPathToAbsolute(installDir: string): string {
|
||||||
|
let transformedPath;
|
||||||
|
if (path.isAbsolute(installDir)) {
|
||||||
|
transformedPath = installDir;
|
||||||
|
} else {
|
||||||
|
transformedPath = installDir.startsWith('~')
|
||||||
|
? path.join(os.homedir(), installDir.slice(1))
|
||||||
|
: (transformedPath = path.join(process.cwd(), installDir));
|
||||||
|
}
|
||||||
|
return path.normalize(transformedPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
static addToPath() {
|
||||||
|
core.addPath(process.env['DOTNET_INSTALL_DIR']!);
|
||||||
|
core.exportVariable('DOTNET_ROOT', process.env['DOTNET_INSTALL_DIR']);
|
||||||
|
}
|
||||||
|
|
||||||
private setQuality(
|
private setQuality(
|
||||||
dotnetVersion: DotnetVersion,
|
dotnetVersion: DotnetVersion,
|
||||||
scriptArguments: string[]
|
scriptArguments: string[]
|
||||||
@ -208,11 +215,6 @@ export class DotnetCoreInstaller {
|
|||||||
scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`);
|
scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
scriptArguments.push(
|
|
||||||
'-InstallDir',
|
|
||||||
`'${DotnetCoreInstaller.installationDirectoryWindows}'`
|
|
||||||
);
|
|
||||||
// process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used
|
|
||||||
scriptPath =
|
scriptPath =
|
||||||
(await io.which('pwsh', false)) || (await io.which('powershell', true));
|
(await io.which('pwsh', false)) || (await io.which('powershell', true));
|
||||||
scriptArguments = windowsDefaultOptions.concat(scriptArguments);
|
scriptArguments = windowsDefaultOptions.concat(scriptArguments);
|
||||||
@ -228,40 +230,26 @@ export class DotnetCoreInstaller {
|
|||||||
if (this.quality) {
|
if (this.quality) {
|
||||||
this.setQuality(dotnetVersion, scriptArguments);
|
this.setQuality(dotnetVersion, scriptArguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_LINUX) {
|
|
||||||
scriptArguments.push(
|
|
||||||
'--install-dir',
|
|
||||||
DotnetCoreInstaller.installationDirectoryLinux
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IS_MAC) {
|
|
||||||
scriptArguments.push(
|
|
||||||
'--install-dir',
|
|
||||||
DotnetCoreInstaller.installationDirectoryMac
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used
|
||||||
|
const getExecOutputOptions = {
|
||||||
|
ignoreReturnCode: true,
|
||||||
|
env: process.env as {string: string}
|
||||||
|
};
|
||||||
const {exitCode, stdout} = await exec.getExecOutput(
|
const {exitCode, stdout} = await exec.getExecOutput(
|
||||||
`"${scriptPath}"`,
|
`"${scriptPath}"`,
|
||||||
scriptArguments,
|
scriptArguments,
|
||||||
{ignoreReturnCode: true}
|
getExecOutputOptions
|
||||||
);
|
);
|
||||||
if (exitCode) {
|
if (exitCode) {
|
||||||
throw new Error(`Failed to install dotnet ${exitCode}. ${stdout}`);
|
throw new Error(`Failed to install dotnet ${exitCode}. ${stdout}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.outputDotnetVersion(
|
return this.outputDotnetVersion(dotnetVersion.value);
|
||||||
dotnetVersion.value,
|
|
||||||
scriptArguments[scriptArguments.length - 1]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async outputDotnetVersion(
|
private async outputDotnetVersion(version): Promise<string> {
|
||||||
version,
|
const installationPath = process.env['DOTNET_INSTALL_DIR']!;
|
||||||
installationPath
|
|
||||||
): Promise<string> {
|
|
||||||
let versionsOnRunner: string[] = await readdir(
|
let versionsOnRunner: string[] = await readdir(
|
||||||
path.join(installationPath.replace(/'/g, ''), 'sdk')
|
path.join(installationPath.replace(/'/g, ''), 'sdk')
|
||||||
);
|
);
|
||||||
|
@ -1,3 +1,2 @@
|
|||||||
export const IS_WINDOWS = process.platform === 'win32';
|
export const IS_WINDOWS = process.platform === 'win32';
|
||||||
export const IS_LINUX = process.platform === 'linux';
|
export const IS_LINUX = process.platform === 'linux';
|
||||||
export const IS_MAC = process.platform === 'darwin';
|
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
||||||
|
|
||||||
/* Additional Checks */
|
/* Additional Checks */
|
||||||
|
"useUnknownInCatchVariables": false, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
||||||
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
||||||
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||||
|
Reference in New Issue
Block a user