@ -229,6 +229,7 @@ const exec = __importStar(__nccwpck_require__(1514));
const io = _ _importStar ( _ _nccwpck _require _ _ ( 7436 ) ) ;
const hc = _ _importStar ( _ _nccwpck _require _ _ ( 6255 ) ) ;
const fs _1 = _ _nccwpck _require _ _ ( 7147 ) ;
const promises _1 = _ _nccwpck _require _ _ ( 3292 ) ;
const path _1 = _ _importDefault ( _ _nccwpck _require _ _ ( 1017 ) ) ;
const semver _1 = _ _importDefault ( _ _nccwpck _require _ _ ( 5911 ) ) ;
const utils _1 = _ _nccwpck _require _ _ ( 918 ) ;
@ -324,8 +325,8 @@ class DotnetCoreInstaller {
}
else {
// This is the default set in install-dotnet.sh
core . addPath ( path_1 . default . join ( process . env [ 'HOME' ] + '' , '.dotnet' ) ) ;
core . exportVariable ( 'DOTNET_ROOT' , path_1 . default . join ( process . env [ 'HOME' ] + '' , '.dotnet' ) ) ;
core . addPath ( DotnetCoreInstaller. installationDirectoryMac ) ;
core . exportVariable ( 'DOTNET_ROOT' , DotnetCoreInstaller. installationDirectoryMac ) ;
}
}
}
@ -372,11 +373,11 @@ class DotnetCoreInstaller {
if ( process . env [ 'no_proxy' ] != null ) {
scriptArguments . push ( ` -ProxyBypassList ${ process . env [ 'no_proxy' ] } ` ) ;
}
scriptArguments . push ( ` -InstallDir '${ DotnetCoreInstaller . installationDirectoryWindows } ' ` ) ;
scriptArguments . push ( '-InstallDir' , ` '${ DotnetCoreInstaller . installationDirectoryWindows } ' ` ) ;
// process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used
scriptPath =
( yield io . which ( 'pwsh' , false ) ) || ( yield io . which ( 'powershell' , true ) ) ;
scriptArguments = [ ... windowsDefaultOptions , scriptArguments . join ( ' ' ) ] ;
scriptArguments = windowsDefaultOptions . concat ( scriptArguments ) ;
}
else {
fs _1 . chmodSync ( escapedScript , '777' ) ;
@ -391,17 +392,31 @@ class DotnetCoreInstaller {
if ( utils _1 . IS _LINUX ) {
scriptArguments . push ( '--install-dir' , DotnetCoreInstaller . installationDirectoryLinux ) ;
}
if ( utils _1 . IS _MAC ) {
scriptArguments . push ( '--install-dir' , DotnetCoreInstaller . installationDirectoryMac ) ;
}
}
const { exitCode , stdout } = yield exec . getExecOutput ( ` " ${ scriptPath } " ` , scriptArguments , { ignoreReturnCode : true } ) ;
if ( exitCode ) {
throw new Error ( ` Failed to install dotnet ${ exitCode } . ${ stdout } ` ) ;
}
return this . outputDotnetVersion ( dotnetVersion . value , scriptArguments [ scriptArguments . length - 1 ] ) ;
} ) ;
}
outputDotnetVersion ( version , installationPath ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
let versionsOnRunner = yield promises _1 . readdir ( path _1 . default . join ( installationPath . replace ( /'/g , '' ) , 'sdk' ) ) ;
let installedVersion = semver _1 . default . maxSatisfying ( versionsOnRunner , version , {
includePrerelease : true
} ) ;
return installedVersion ;
} ) ;
}
}
exports . DotnetCoreInstaller = DotnetCoreInstaller ;
DotnetCoreInstaller . installationDirectoryWindows = path _1 . default . join ( process . env [ 'PROGRAMFILES' ] + '' , 'dotnet' ) ;
DotnetCoreInstaller . installationDirectoryLinux = '/usr/share/dotnet' ;
DotnetCoreInstaller . installationDirectoryMac = path _1 . default . join ( process . env [ 'HOME' ] + '' , '.dotnet' ) ;
/***/ } ) ,
@ -448,6 +463,7 @@ const core = __importStar(__nccwpck_require__(2186));
const installer _1 = _ _nccwpck _require _ _ ( 1480 ) ;
const fs = _ _importStar ( _ _nccwpck _require _ _ ( 7147 ) ) ;
const path _1 = _ _importDefault ( _ _nccwpck _require _ _ ( 1017 ) ) ;
const semver _1 = _ _importDefault ( _ _nccwpck _require _ _ ( 5911 ) ) ;
const auth = _ _importStar ( _ _nccwpck _require _ _ ( 8527 ) ) ;
const qualityOptions = [
'daily' ,
@ -469,6 +485,7 @@ function run() {
// Proxy, auth, (etc) are still set up, even if no version is identified
//
const versions = core . getMultilineInput ( 'dotnet-version' ) ;
const installedDotnetVersions = [ ] ;
const globalJsonFileInput = core . getInput ( 'global-json-file' ) ;
if ( globalJsonFileInput ) {
const globalJsonPath = path _1 . default . join ( process . cwd ( ) , globalJsonFileInput ) ;
@ -494,7 +511,8 @@ function run() {
const uniqueVersions = new Set ( versions ) ;
for ( const version of uniqueVersions ) {
dotnetInstaller = new installer _1 . DotnetCoreInstaller ( version , quality ) ;
yield dotnetInstaller . installDotnet ( ) ;
const installedVersion = yield dotnetInstaller . installDotnet ( ) ;
installedDotnetVersions . push ( installedVersion ) ;
}
installer _1 . DotnetCoreInstaller . addToPath ( ) ;
}
@ -503,6 +521,13 @@ function run() {
if ( sourceUrl ) {
auth . configAuthentication ( sourceUrl , configFile ) ;
}
const comparisonRange = globalJsonFileInput
? versions [ versions . length - 1 ]
: '*' ;
const versionToOutput = semver _1 . default . maxSatisfying ( installedDotnetVersions , comparisonRange , {
includePrerelease : true
} ) ;
core . setOutput ( 'dotnet-version' , versionToOutput ) ;
const matchersPath = path _1 . default . join ( _ _dirname , '..' , '.github' ) ;
core . info ( ` ##[add-matcher] ${ path _1 . default . join ( matchersPath , 'csc.json' ) } ` ) ;
}
@ -538,9 +563,10 @@ run();
"use strict" ;
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
exports . IS _LINUX = exports . IS _WINDOWS = void 0 ;
exports . IS _MAC = exports . IS _LINUX = exports . IS _WINDOWS = void 0 ;
exports . IS _WINDOWS = process . platform === 'win32' ;
exports . IS _LINUX = process . platform === 'linux' ;
exports . IS _MAC = process . platform === 'darwin' ;
/***/ } ) ,
@ -21016,6 +21042,14 @@ module.exports = require("fs");
/***/ } ) ,
/***/ 3292 :
/***/ ( ( module ) => {
"use strict" ;
module . exports = require ( "fs/promises" ) ;
/***/ } ) ,
/***/ 3685 :
/***/ ( ( module ) => {