You've already forked setup-dotnet
mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-07-10 09:00:33 +07:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
bb95ce727f | |||
cc372bb13c | |||
86c0b21a03 | |||
d6b77de15f | |||
d9c317d9d5 | |||
c61e78b585 | |||
6c0e2a2a6b | |||
a668ade667 | |||
a2db70294c | |||
1c11308e52 |
2
.github/workflows/workflow.yml
vendored
2
.github/workflows/workflow.yml
vendored
@ -1,5 +1,5 @@
|
|||||||
name: Main workflow
|
name: Main workflow
|
||||||
on: [push]
|
on: [push, pull_request]
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
name: Run
|
name: Run
|
||||||
|
99
.gitignore
vendored
99
.gitignore
vendored
@ -1,7 +1,92 @@
|
|||||||
# runtime dependencies are checked in
|
# Explicitly not ignoring node_modules so that they are included in package downloaded by runner
|
||||||
# dev dependencies are *not* checked in
|
!node_modules/
|
||||||
node_modules/.bin
|
__tests__/runner/*
|
||||||
node_modules/typescript
|
|
||||||
node_modules/@types
|
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
||||||
node_modules/prettier
|
# Logs
|
||||||
__tests__/runner/*
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
*.pid.lock
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage
|
||||||
|
*.lcov
|
||||||
|
|
||||||
|
# nyc test coverage
|
||||||
|
.nyc_output
|
||||||
|
|
||||||
|
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# Bower dependency directory (https://bower.io/)
|
||||||
|
bower_components
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# TypeScript v1 declaration files
|
||||||
|
typings/
|
||||||
|
|
||||||
|
# TypeScript cache
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional eslint cache
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
.node_repl_history
|
||||||
|
|
||||||
|
# Output of 'npm pack'
|
||||||
|
*.tgz
|
||||||
|
|
||||||
|
# Yarn Integrity file
|
||||||
|
.yarn-integrity
|
||||||
|
|
||||||
|
# dotenv environment variables file
|
||||||
|
.env
|
||||||
|
.env.test
|
||||||
|
|
||||||
|
# parcel-bundler cache (https://parceljs.org/)
|
||||||
|
.cache
|
||||||
|
|
||||||
|
# next.js build output
|
||||||
|
.next
|
||||||
|
|
||||||
|
# nuxt.js build output
|
||||||
|
.nuxt
|
||||||
|
|
||||||
|
# vuepress build output
|
||||||
|
.vuepress/dist
|
||||||
|
|
||||||
|
# Serverless directories
|
||||||
|
.serverless/
|
||||||
|
|
||||||
|
# FuseBox cache
|
||||||
|
.fusebox/
|
||||||
|
|
||||||
|
# DynamoDB Local files
|
||||||
|
.dynamodb/
|
||||||
|
@ -7,6 +7,7 @@ inputs:
|
|||||||
# Deprecated option, do not use. Will not be supported after October 1, 2019
|
# Deprecated option, do not use. Will not be supported after October 1, 2019
|
||||||
version:
|
version:
|
||||||
description: 'Deprecated. Use dotnet-version instead. Will not be supported after October 1, 2019'
|
description: 'Deprecated. Use dotnet-version instead. Will not be supported after October 1, 2019'
|
||||||
|
deprecationMessage: 'The version property will not be supported after October 1, 2019. Use dotnet-version instead'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'lib/setup-dotnet.js'
|
main: 'lib/setup-dotnet.js'
|
||||||
|
14
externals/install-dotnet.ps1
vendored
14
externals/install-dotnet.ps1
vendored
@ -46,6 +46,7 @@
|
|||||||
Possible values:
|
Possible values:
|
||||||
- dotnet - the Microsoft.NETCore.App shared runtime
|
- dotnet - the Microsoft.NETCore.App shared runtime
|
||||||
- aspnetcore - the Microsoft.AspNetCore.App shared runtime
|
- aspnetcore - the Microsoft.AspNetCore.App shared runtime
|
||||||
|
- windowsdesktop - the Microsoft.WindowsDesktop.App shared runtime
|
||||||
.PARAMETER DryRun
|
.PARAMETER DryRun
|
||||||
If set it will not perform installation but instead display what command line to use to consistently install
|
If set it will not perform installation but instead display what command line to use to consistently install
|
||||||
currently requested version of dotnet cli. In example if you specify version 'latest' it will display a link
|
currently requested version of dotnet cli. In example if you specify version 'latest' it will display a link
|
||||||
@ -83,7 +84,7 @@ param(
|
|||||||
[string]$Version="Latest",
|
[string]$Version="Latest",
|
||||||
[string]$InstallDir="<auto>",
|
[string]$InstallDir="<auto>",
|
||||||
[string]$Architecture="<auto>",
|
[string]$Architecture="<auto>",
|
||||||
[ValidateSet("dotnet", "aspnetcore", IgnoreCase = $false)]
|
[ValidateSet("dotnet", "aspnetcore", "windowsdesktop", IgnoreCase = $false)]
|
||||||
[string]$Runtime,
|
[string]$Runtime,
|
||||||
[Obsolete("This parameter may be removed in a future version of this script. The recommended alternative is '-Runtime dotnet'.")]
|
[Obsolete("This parameter may be removed in a future version of this script. The recommended alternative is '-Runtime dotnet'.")]
|
||||||
[switch]$SharedRuntime,
|
[switch]$SharedRuntime,
|
||||||
@ -268,6 +269,10 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [bool]$Co
|
|||||||
elseif ($Runtime -eq "aspnetcore") {
|
elseif ($Runtime -eq "aspnetcore") {
|
||||||
$VersionFileUrl = "$UncachedFeed/aspnetcore/Runtime/$Channel/latest.version"
|
$VersionFileUrl = "$UncachedFeed/aspnetcore/Runtime/$Channel/latest.version"
|
||||||
}
|
}
|
||||||
|
# Currently, the WindowsDesktop runtime is manufactured with the .Net core runtime
|
||||||
|
elseif ($Runtime -eq "windowsdesktop") {
|
||||||
|
$VersionFileUrl = "$UncachedFeed/Runtime/$Channel/latest.version"
|
||||||
|
}
|
||||||
elseif (-not $Runtime) {
|
elseif (-not $Runtime) {
|
||||||
if ($Coherent) {
|
if ($Coherent) {
|
||||||
$VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.coherent.version"
|
$VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.coherent.version"
|
||||||
@ -325,6 +330,9 @@ function Get-Download-Link([string]$AzureFeed, [string]$SpecificVersion, [string
|
|||||||
elseif ($Runtime -eq "aspnetcore") {
|
elseif ($Runtime -eq "aspnetcore") {
|
||||||
$PayloadURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/aspnetcore-runtime-$SpecificVersion-win-$CLIArchitecture.zip"
|
$PayloadURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/aspnetcore-runtime-$SpecificVersion-win-$CLIArchitecture.zip"
|
||||||
}
|
}
|
||||||
|
elseif ($Runtime -eq "windowsdesktop") {
|
||||||
|
$PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/windowsdesktop-runtime-$SpecificVersion-win-$CLIArchitecture.zip"
|
||||||
|
}
|
||||||
elseif (-not $Runtime) {
|
elseif (-not $Runtime) {
|
||||||
$PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-sdk-$SpecificVersion-win-$CLIArchitecture.zip"
|
$PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-sdk-$SpecificVersion-win-$CLIArchitecture.zip"
|
||||||
}
|
}
|
||||||
@ -564,6 +572,10 @@ elseif ($Runtime -eq "aspnetcore") {
|
|||||||
$assetName = "ASP.NET Core Runtime"
|
$assetName = "ASP.NET Core Runtime"
|
||||||
$dotnetPackageRelativePath = "shared\Microsoft.AspNetCore.App"
|
$dotnetPackageRelativePath = "shared\Microsoft.AspNetCore.App"
|
||||||
}
|
}
|
||||||
|
elseif ($Runtime -eq "windowsdesktop") {
|
||||||
|
$assetName = ".NET Core Windows Desktop Runtime"
|
||||||
|
$dotnetPackageRelativePath = "shared\Microsoft.WindowsDesktop.App"
|
||||||
|
}
|
||||||
elseif (-not $Runtime) {
|
elseif (-not $Runtime) {
|
||||||
$assetName = ".NET Core SDK"
|
$assetName = ".NET Core SDK"
|
||||||
$dotnetPackageRelativePath = "sdk"
|
$dotnetPackageRelativePath = "sdk"
|
||||||
|
8
externals/install-dotnet.sh
vendored
8
externals/install-dotnet.sh
vendored
@ -148,7 +148,7 @@ get_linux_platform_name() {
|
|||||||
return 0
|
return 0
|
||||||
elif [ -e /etc/redhat-release ]; then
|
elif [ -e /etc/redhat-release ]; then
|
||||||
local redhatRelease=$(</etc/redhat-release)
|
local redhatRelease=$(</etc/redhat-release)
|
||||||
if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
|
if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux "*" release 6."* ]]; then
|
||||||
echo "rhel.6"
|
echo "rhel.6"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@ -612,6 +612,9 @@ copy_files_or_dirs_from_list() {
|
|||||||
local target="$out_path/$path"
|
local target="$out_path/$path"
|
||||||
if [ "$override" = true ] || (! ([ -d "$target" ] || [ -e "$target" ])); then
|
if [ "$override" = true ] || (! ([ -d "$target" ] || [ -e "$target" ])); then
|
||||||
mkdir -p "$out_path/$(dirname "$path")"
|
mkdir -p "$out_path/$(dirname "$path")"
|
||||||
|
if [ -d "$target" ]; then
|
||||||
|
rm -rf "$target"
|
||||||
|
fi
|
||||||
cp -R $override_switch "$root_path/$path" "$target"
|
cp -R $override_switch "$root_path/$path" "$target"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -868,6 +871,9 @@ do
|
|||||||
runtime="$1"
|
runtime="$1"
|
||||||
if [[ "$runtime" != "dotnet" ]] && [[ "$runtime" != "aspnetcore" ]]; then
|
if [[ "$runtime" != "dotnet" ]] && [[ "$runtime" != "aspnetcore" ]]; then
|
||||||
say_err "Unsupported value for --runtime: '$1'. Valid values are 'dotnet' and 'aspnetcore'."
|
say_err "Unsupported value for --runtime: '$1'. Valid values are 'dotnet' and 'aspnetcore'."
|
||||||
|
if [[ "$runtime" == "windowsdesktop" ]]; then
|
||||||
|
say_err "WindowsDesktop archives are manufactured for Windows platforms only."
|
||||||
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -72,6 +72,8 @@ class DotnetCoreInstaller {
|
|||||||
else {
|
else {
|
||||||
console.log('Using cached tool');
|
console.log('Using cached tool');
|
||||||
}
|
}
|
||||||
|
// Need to set this so that .NET Core global tools find the right locations.
|
||||||
|
core.exportVariable('DOTNET_ROOT', toolPath);
|
||||||
// Prepend the tools path. instructs the agent to prepend for future tasks
|
// Prepend the tools path. instructs the agent to prepend for future tasks
|
||||||
core.addPath(toolPath);
|
core.addPath(toolPath);
|
||||||
});
|
});
|
||||||
|
@ -58,6 +58,9 @@ export class DotnetCoreInstaller {
|
|||||||
console.log('Using cached tool');
|
console.log('Using cached tool');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Need to set this so that .NET Core global tools find the right locations.
|
||||||
|
core.exportVariable('DOTNET_ROOT', toolPath);
|
||||||
|
|
||||||
// Prepend the tools path. instructs the agent to prepend for future tasks
|
// Prepend the tools path. instructs the agent to prepend for future tasks
|
||||||
core.addPath(toolPath);
|
core.addPath(toolPath);
|
||||||
}
|
}
|
||||||
@ -171,6 +174,7 @@ export class DotnetCoreInstaller {
|
|||||||
this.version,
|
this.version,
|
||||||
this.arch
|
this.arch
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log('Successfully installed', this.version);
|
console.log('Successfully installed', this.version);
|
||||||
return cachedDir;
|
return cachedDir;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user