@ -71171,9 +71171,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
var _ _importDefault = ( this && this . _ _importDefault ) || function ( mod ) {
return ( mod && mod . _ _esModule ) ? mod : { "default" : mod } ;
} ;
var _a ;
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
exports . DotnetCoreInstaller = exports . Dotnet VersionResolver = void 0 ;
exports . DotnetCoreInstaller = exports . Dotnet InstallDir = exports . DotnetInstallScript = exports . Dotnet VersionResolver = void 0 ;
// Load tempDirectory before it gets wiped by tool-cache
const core = _ _importStar ( _ _nccwpck _require _ _ ( 2186 ) ) ;
const exec = _ _importStar ( _ _nccwpck _require _ _ ( 1514 ) ) ;
@ -71208,8 +71207,8 @@ class DotnetVersionResolver {
return /^\d+$/ . test ( versionTag ) ;
}
isLatestPatchSyntax ( ) {
var _ b, _c ;
const majorTag = ( _ c = ( _b = this . inputVersion . match ( /^(?<majorTag>\d+)\.\d+\.\d{1}x{2}$/ ) ) === null || _ b === void 0 ? void 0 : _b . groups ) === null || _c === void 0 ? void 0 : _c . majorTag ;
var _ a, _b ;
const majorTag = ( _ b = ( _a = this . inputVersion . match ( /^(?<majorTag>\d+)\.\d+\.\d{1}x{2}$/ ) ) === null || _ a === void 0 ? void 0 : _a . groups ) === null || _b === void 0 ? void 0 : _b . majorTag ;
if ( majorTag &&
parseInt ( majorTag ) < LATEST _PATCH _SYNTAX _MINIMAL _MAJOR _TAG ) {
throw new Error ( ` The 'dotnet-version' was supplied in invalid format: ${ this . inputVersion } ! The A.B.Cxx syntax is available since the .NET 5.0 release. ` ) ;
@ -71241,7 +71240,7 @@ class DotnetVersionResolver {
parseInt ( major ) >= QUALITY _INPUT _MINIMAL _MAJOR _TAG ? true : false ;
} ) ;
}
createDot N etVersion( ) {
createDot n etVersion( ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
yield this . resolveVersionInput ( ) ;
if ( ! this . resolvedArgument . type ) {
@ -71264,7 +71263,7 @@ class DotnetVersionResolver {
allowRetries : true ,
maxRetries : 3
} ) ;
const response = yield httpClient . getJson ( DotnetVersionResolver . Dot N etCoreIndexUrl) ;
const response = yield httpClient . getJson ( DotnetVersionResolver . Dot n etCoreIndexUrl) ;
const result = response . result || { } ;
const releasesInfo = result [ 'releases-index' ] ;
const releaseInfo = releasesInfo . find ( info => {
@ -71272,99 +71271,124 @@ class DotnetVersionResolver {
return sdkParts [ 0 ] === majorTag ;
} ) ;
if ( ! releaseInfo ) {
throw new Error ( ` Could not find info for version with major tag: " ${ majorTag } " at ${ DotnetVersionResolver . Dot N etCoreIndexUrl} ` ) ;
throw new Error ( ` Could not find info for version with major tag: " ${ majorTag } " at ${ DotnetVersionResolver . Dot n etCoreIndexUrl} ` ) ;
}
return releaseInfo [ 'channel-version' ] ;
} ) ;
}
}
exports . DotnetVersionResolver = DotnetVersionResolver ;
DotnetVersionResolver . DotNetCoreIndexUrl = 'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json' ;
class DotnetCoreInstaller {
constructor ( version , quality ) {
this . version = version ;
this . quality = quality ;
DotnetVersionResolver . DotnetCoreIndexUrl = 'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json' ;
class DotnetInstallScript {
constructor ( ) {
this . scriptName = utils _1 . IS _WINDOWS ? 'install-dotnet.ps1' : 'install-dotnet.sh' ;
this . scriptArguments = [ ] ;
this . escapedScript = path _1 . default
. join ( _ _dirname , '..' , '..' , 'externals' , this . scriptName )
. replace ( /'/g , "''" ) ;
if ( utils _1 . IS _WINDOWS ) {
this . setupScriptPowershell ( ) ;
return ;
}
this . setupScriptBash ( ) ;
}
setupScriptPowershell ( ) {
this . scriptArguments = [
'-NoLogo' ,
'-Sta' ,
'-NoProfile' ,
'-NonInteractive' ,
'-ExecutionPolicy' ,
'Unrestricted' ,
'-Command'
] ;
this . scriptArguments . push ( '&' , ` ' ${ this . escapedScript } ' ` ) ;
if ( process . env [ 'https_proxy' ] != null ) {
this . scriptArguments . push ( ` -ProxyAddress ${ process . env [ 'https_proxy' ] } ` ) ;
}
// This is not currently an option
if ( process . env [ 'no_proxy' ] != null ) {
this . scriptArguments . push ( ` -ProxyBypassList ${ process . env [ 'no_proxy' ] } ` ) ;
}
}
static convertInstallPathToAbsolute ( installDir ) {
let transformedPath ;
if ( path _1 . default . isAbsolute ( installDir ) ) {
transformedPath = installDir ;
setupScriptBash ( ) {
( 0 , fs _1 . chmodSync ) ( this . escapedScript , '777' ) ;
}
getScriptPath ( ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
if ( utils _1 . IS _WINDOWS ) {
return ( yield io . which ( 'pwsh' , false ) ) || io . which ( 'powershell' , true ) ;
}
return io . which ( this . escapedScript , true ) ;
} ) ;
}
useArguments ( ... args ) {
this . scriptArguments . push ( ... args ) ;
return this ;
}
useVersion ( dotnetVersion , quality ) {
if ( dotnetVersion . type ) {
this . useArguments ( dotnetVersion . type , dotnetVersion . value ) ;
}
else {
transformedPath = installDir . startsWith ( '~' )
? path _1 . default . join ( os _1 . default . homedir ( ) , installDir . slice ( 1 ) )
: ( transformedPath = path _1 . default . join ( process . cwd ( ) , installDir ) ) ;
if ( quality && ! dotnetVersion . qualityFlag ) {
core . warning ( ` The 'dotnet-quality' input can be used only with .NET SDK version in A.B, A.B.x, A, A.x and A.B.Cxx formats where the major tag is higher than 5. You specified: ${ dotnetVersion . value } . 'dotnet-quality' input is ignored. ` ) ;
return this ;
}
if ( quality ) {
this . useArguments ( utils _1 . IS _WINDOWS ? '-Quality' : '--quality' , quality ) ;
}
return this ;
}
execute ( ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
const getExecOutputOptions = {
ignoreReturnCode : true ,
env : process . env
} ;
return exec . getExecOutput ( ` " ${ yield this . getScriptPath ( ) } " ` , this . scriptArguments , getExecOutputOptions ) ;
} ) ;
}
}
exports . DotnetInstallScript = DotnetInstallScript ;
class DotnetInstallDir {
static convertInstallPathToAbsolute ( installDir ) {
if ( path _1 . default . isAbsolute ( installDir ) )
return path _1 . default . normalize ( installDir ) ;
const transformedPath = installDir . startsWith ( '~' )
? path _1 . default . join ( os _1 . default . homedir ( ) , installDir . slice ( 1 ) )
: path _1 . default . join ( process . cwd ( ) , installDir ) ;
return path _1 . default . normalize ( transformedPath ) ;
}
static addToPath ( ) {
core . addPath ( process . env [ 'DOTNET_INSTALL_DIR' ] ) ;
core . exportVariable ( 'DOTNET_ROOT' , process . env [ 'DOTNET_INSTALL_DIR' ] ) ;
}
setQuality ( dotnetVersion , scriptArguments ) {
const option = utils _1 . IS _WINDOWS ? '-Quality' : '--quality' ;
if ( dotnetVersion . qualityFlag ) {
scriptArguments . push ( option , this . quality ) ;
}
else {
core . warning ( ` The 'dotnet-quality' input can be used only with .NET SDK version in A.B, A.B.x, A, A.x and A.B.Cxx formats where the major tag is higher than 5. You specified: ${ this . version } . 'dotnet-quality' input is ignored. ` ) ;
}
static setEnvironmentVariable ( ) {
process . env [ 'DOTNET_INSTALL_DIR' ] = DotnetInstallDir . dirPath ;
}
}
exports . DotnetInstallDir = DotnetInstallDir ;
DotnetInstallDir . default = {
linux : '/usr/share/dotnet' ,
mac : path _1 . default . join ( process . env [ 'HOME' ] + '' , '.dotnet' ) ,
windows : path _1 . default . join ( process . env [ 'PROGRAMFILES' ] + '' , 'dotnet' )
} ;
DotnetInstallDir . dirPath = process . env [ 'DOTNET_INSTALL_DIR' ]
? DotnetInstallDir . convertInstallPathToAbsolute ( process . env [ 'DOTNET_INSTALL_DIR' ] )
: DotnetInstallDir . default [ utils _1 . PLATFORM ] ;
class DotnetCoreInstaller {
constructor ( version , quality ) {
this . version = version ;
this . quality = quality ;
}
installDotnet ( ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
const windowsDefaultOptions = [
'-NoLogo' ,
'-Sta' ,
'-NoProfile' ,
'-NonInteractive' ,
'-ExecutionPolicy' ,
'Unrestricted' ,
'-Command'
] ;
const scriptName = utils _1 . IS _WINDOWS ? 'install-dotnet.ps1' : 'install-dotnet.sh' ;
const escapedScript = path _1 . default
. join ( _ _dirname , '..' , '..' , 'externals' , scriptName )
. replace ( /'/g , "''" ) ;
let scriptArguments ;
let scriptPath = '' ;
const versionResolver = new DotnetVersionResolver ( this . version ) ;
const dotnetVersion = yield versionResolver . createDotNetVersion ( ) ;
if ( utils _1 . IS _WINDOWS ) {
scriptArguments = [ '&' , ` ' ${ escapedScript } ' ` ] ;
if ( dotnetVersion . type ) {
scriptArguments . push ( dotnetVersion . type , dotnetVersion . value ) ;
}
if ( this . quality ) {
this . setQuality ( dotnetVersion , scriptArguments ) ;
}
if ( process . env [ 'https_proxy' ] != null ) {
scriptArguments . push ( ` -ProxyAddress ${ process . env [ 'https_proxy' ] } ` ) ;
}
// This is not currently an option
if ( process . env [ 'no_proxy' ] != null ) {
scriptArguments . push ( ` -ProxyBypassList ${ process . env [ 'no_proxy' ] } ` ) ;
}
scriptPath =
( yield io . which ( 'pwsh' , false ) ) || ( yield io . which ( 'powershell' , true ) ) ;
scriptArguments = windowsDefaultOptions . concat ( scriptArguments ) ;
}
else {
( 0 , fs _1 . chmodSync ) ( escapedScript , '777' ) ;
scriptPath = yield io . which ( escapedScript , true ) ;
scriptArguments = [ ] ;
if ( dotnetVersion . type ) {
scriptArguments . push ( dotnetVersion . type , dotnetVersion . value ) ;
}
if ( this . quality ) {
this . setQuality ( dotnetVersion , scriptArguments ) ;
}
}
// process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used
const getExecOutputOptions = {
ignoreReturnCode : true ,
env : process . env
} ;
const { exitCode , stdout , stderr } = yield exec . getExecOutput ( ` " ${ scriptPath } " ` , scriptArguments , getExecOutputOptions ) ;
const dotnetVersion = yield versionResolver . createDotnetVersion ( ) ;
const installScript = new DotnetInstallScript ( )
. useArguments ( utils _1 . IS _WINDOWS ? '-SkipNonVersionedFiles' : '--skip-non-versioned-files' )
. useVersion ( dotnetVersion , this . quality ) ;
const { exitCode , stderr , stdout } = yield installScript . execute ( ) ;
if ( exitCode ) {
throw new Error ( ` Failed to install dotnet, exit code: ${ exitCode } . ${ stderr } ` ) ;
}
@ -71382,26 +71406,8 @@ class DotnetCoreInstaller {
}
}
exports . DotnetCoreInstaller = DotnetCoreInstaller ;
_a = DotnetCoreInstaller ;
( ( ) => {
const installationDirectoryWindows = path _1 . default . join ( process . env [ 'PROGRAMFILES' ] + '' , 'dotnet' ) ;
const installationDirectoryLinux = '/usr/share/dotnet' ;
const installationDirectoryMac = path _1 . default . join ( process . env [ 'HOME' ] + '' , '.dotnet' ) ;
const dotnetInstallDir = process . env [ 'DOTNET_INSTALL_DIR' ] ;
if ( dotnetInstallDir ) {
process . env [ 'DOTNET_INSTALL_DIR' ] =
_a . convertInstallPathToAbsolute ( dotnetInstallDir ) ;
}
else {
if ( utils _1 . IS _WINDOWS ) {
process . env [ 'DOTNET_INSTALL_DIR' ] = installationDirectoryWindows ;
}
else {
process . env [ 'DOTNET_INSTALL_DIR' ] = utils _1 . IS _LINUX
? installationDirectoryLinux
: installationDirectoryMac ;
}
}
DotnetInstallDir . setEnvironmentVariable ( ) ;
} ) ( ) ;
@ -71510,7 +71516,7 @@ function run() {
const installedVersion = yield dotnetInstaller . installDotnet ( ) ;
installedDotnetVersions . push ( installedVersion ) ;
}
installer _1 . Dotnet CoreInstalle r. addToPath ( ) ;
installer _1 . Dotnet InstallDi r. addToPath ( ) ;
}
const sourceUrl = core . getInput ( 'source-url' ) ;
const configFile = core . getInput ( 'config-file' ) ;
@ -71576,9 +71582,15 @@ run();
"use strict" ;
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
exports . IS_LINUX = exports . IS _WINDOWS = void 0 ;
exports . PLATFORM = exports . IS _WINDOWS = void 0 ;
exports . IS _WINDOWS = process . platform === 'win32' ;
exports . IS _LINUX = process . platform === 'linux' ;
exports . PLATFORM = ( ( ) => {
if ( process . platform === 'win32' )
return 'windows' ;
if ( process . platform === 'linux' )
return 'linux' ;
return 'mac' ;
} ) ( ) ;
/***/ } ) ,