diff --git a/dist/tools/libs/tools.mjs b/dist/tools/libs/tools.mjs index 8ac4890b6..da74b3128 100644 --- a/dist/tools/libs/tools.mjs +++ b/dist/tools/libs/tools.mjs @@ -81,6 +81,7 @@ class DotnetTool { if (!toolPath) { toolPath = await this.buildAgent.which(this.toolName, true); } + args = ["--roll-forward Major", ...args]; return await this.execute(toolPath, args); } async isValidInputFile(input, file) { diff --git a/dist/tools/libs/tools.mjs.map b/dist/tools/libs/tools.mjs.map index 516b59276..654346813 100644 --- a/dist/tools/libs/tools.mjs.map +++ b/dist/tools/libs/tools.mjs.map @@ -1 +1 @@ -{"version":3,"file":"tools.mjs","sources":["../../../src/tools/common/dotnet-tool.ts","../../../src/tools/common/settings.ts","../../../src/tools/common/index.ts","../../../src/tools/common/runner.ts"],"sourcesContent":["import * as crypto from 'node:crypto'\nimport * as fs from 'node:fs/promises'\nimport * as os from 'node:os'\nimport * as path from 'node:path'\n\nimport * as semver from 'semver'\nimport { type IBuildAgent, type ExecResult } from '@agents/common'\nimport { ISettingsProvider } from './settings'\nimport { NugetVersions } from './models'\n\nexport interface IDotnetTool {\n toolName: string\n\n disableTelemetry(): void\n\n install(): Promise\n}\n\nexport abstract class DotnetTool implements IDotnetTool {\n private static readonly nugetRoot: string = 'https://azuresearch-usnc.nuget.org/query'\n\n constructor(protected buildAgent: IBuildAgent) {}\n\n abstract get packageName(): string\n\n abstract get toolName(): string\n\n abstract get toolPathVariable(): string\n\n abstract get versionRange(): string | null\n\n abstract get settingsProvider(): ISettingsProvider\n\n disableTelemetry(): void {\n this.buildAgent.info('Disable Telemetry')\n this.buildAgent.setVariable('DOTNET_CLI_TELEMETRY_OPTOUT', 'true')\n this.buildAgent.setVariable('DOTNET_NOLOGO', 'true')\n }\n\n async install(): Promise {\n const dotnetExePath = await this.buildAgent.which('dotnet', true)\n this.buildAgent.debug(`whichPath: ${dotnetExePath}`)\n await this.setDotnetRoot()\n\n const setupSettings = this.settingsProvider.getSetupSettings()\n\n let version: string | null = semver.clean(setupSettings.versionSpec) || setupSettings.versionSpec\n this.buildAgent.info('--------------------------')\n this.buildAgent.info(`Acquiring ${this.packageName} for version spec: ${version}`)\n this.buildAgent.info('--------------------------')\n\n if (!this.isExplicitVersion(version)) {\n version = await this.queryLatestMatch(this.packageName, version, setupSettings.includePrerelease)\n if (!version) {\n throw new Error(`Unable to find ${this.packageName} version '${version}'.`)\n }\n }\n\n if (this.versionRange && !semver.satisfies(version, this.versionRange, { includePrerelease: setupSettings.includePrerelease })) {\n throw new Error(\n `Version spec '${setupSettings.versionSpec}' resolved as '${version}' does not satisfy the range '${this.versionRange}'.` +\n 'See https://github.com/GitTools/actions/blob/main/docs/versions.md for more information.'\n )\n }\n\n let toolPath: string | null = null\n if (!setupSettings.preferLatestVersion) {\n // Let's try and resolve the version locally first\n toolPath = await this.buildAgent.findLocalTool(this.packageName, version)\n if (toolPath) {\n this.buildAgent.info('--------------------------')\n this.buildAgent.info(`${this.packageName} version: ${version} found in local cache at ${toolPath}.`)\n this.buildAgent.info('--------------------------')\n }\n }\n\n if (!toolPath) {\n // Download, extract, cache\n toolPath = await this.installTool(this.packageName, version, setupSettings.ignoreFailedSources)\n this.buildAgent.info('--------------------------')\n this.buildAgent.info(`${this.packageName} version: ${version} installed.`)\n this.buildAgent.info('--------------------------')\n }\n\n // Prepend the tool's path. This prepends the PATH for the current process and\n // instructs the agent to prepend for each task that follows.\n this.buildAgent.info(`Prepending ${toolPath} to PATH`)\n this.buildAgent.addPath(toolPath)\n\n const pathVariable = this.toolPathVariable\n this.buildAgent.info(`Set ${pathVariable} to ${toolPath}`)\n this.buildAgent.setVariable(pathVariable, toolPath)\n this.buildAgent.setSucceeded(`${this.toolName} installed successfully`, true)\n\n return toolPath\n }\n\n protected async execute(cmd: string, args: string[]): Promise {\n this.buildAgent.info(`Command: ${cmd} ${args.join(' ')}`)\n return await this.buildAgent.exec(cmd, args)\n }\n\n protected async setDotnetRoot(): Promise {\n if (os.platform() !== 'win32' && !this.buildAgent.getVariable('DOTNET_ROOT')) {\n let dotnetPath = await this.buildAgent.which('dotnet', true)\n\n const stats = await fs.lstat(dotnetPath)\n if (stats.isSymbolicLink()) {\n dotnetPath = (await fs.readlink(dotnetPath)) || dotnetPath\n }\n const dotnetRoot = path.dirname(dotnetPath)\n this.buildAgent.setVariable('DOTNET_ROOT', dotnetRoot)\n }\n }\n\n protected async executeTool(args: string[]): Promise {\n let toolPath: string | undefined\n const variableAsPath = this.buildAgent.getVariableAsPath(this.toolPathVariable)\n if (variableAsPath) {\n toolPath = path.join(variableAsPath, os.platform() === 'win32' ? `${this.toolName}.exe` : this.toolName)\n }\n if (!toolPath) {\n toolPath = await this.buildAgent.which(this.toolName, true)\n }\n return await this.execute(toolPath, args)\n }\n\n protected async isValidInputFile(input: string, file: string): Promise {\n return this.filePathSupplied(input) && (await this.buildAgent.fileExists(file))\n }\n\n protected filePathSupplied(file: string): boolean {\n const pathValue = path.resolve(this.buildAgent.getInput(file) || '')\n const repoRoot = this.buildAgent.sourceDir\n return pathValue !== repoRoot\n }\n\n protected async getRepoPath(targetPath: string): Promise {\n const srcDir = this.buildAgent.sourceDir || '.'\n let workDir: string\n if (!targetPath) {\n workDir = srcDir\n } else {\n if (await this.buildAgent.directoryExists(targetPath)) {\n workDir = targetPath\n } else {\n throw new Error(`Directory not found at ${targetPath}`)\n }\n }\n return workDir.replace(/\\\\/g, '/')\n }\n\n private async queryLatestMatch(toolName: string, versionSpec: string, includePrerelease: boolean): Promise {\n this.buildAgent.info(\n `Querying tool versions for ${toolName}${versionSpec ? `@${versionSpec}` : ''} ${includePrerelease ? 'including pre-releases' : ''}`\n )\n\n const toolNameParam = encodeURIComponent(toolName.toLowerCase())\n const prereleaseParam = includePrerelease ? 'true' : 'false'\n const downloadPath = `${DotnetTool.nugetRoot}?q=${toolNameParam}&prerelease=${prereleaseParam}&semVerLevel=2.0.0&take=1`\n\n const response = await fetch(downloadPath)\n\n if (!response || !response.ok) {\n this.buildAgent.info(`failed to query latest version for ${toolName} from ${downloadPath}. Status code: ${response ? response.status : 'unknown'}`)\n return null\n }\n\n const { data } = (await response.json()) as NugetVersions\n\n const versions = data[0].versions.map(x => x.version)\n if (!versions || !versions.length) {\n return null\n }\n\n this.buildAgent.debug(`got versions: ${versions.join(', ')}`)\n\n const version = semver.maxSatisfying(versions, versionSpec, { includePrerelease })\n if (version) {\n this.buildAgent.info(`Found matching version: ${version}`)\n } else {\n this.buildAgent.info('match not found')\n }\n\n return version\n }\n\n private async installTool(toolName: string, version: string, ignoreFailedSources: boolean): Promise {\n const semverVersion = semver.clean(version)\n if (!semverVersion) {\n throw new Error(`Invalid version spec: ${version}`)\n }\n\n const tempDirectory = await this.createTempDirectory()\n\n if (!tempDirectory) {\n throw new Error('Unable to create temp directory')\n }\n\n const args = ['tool', 'install', toolName, '--tool-path', tempDirectory, '--version', semverVersion]\n if (ignoreFailedSources) {\n args.push('--ignore-failed-sources')\n }\n\n const result = await this.execute('dotnet', args)\n const status = result.code === 0 ? 'success' : 'failure'\n const message = result.code === 0 ? result.stdout : result.stderr\n\n this.buildAgent.debug(`Tool install result: ${status} ${message}`)\n\n if (result.code !== 0) {\n throw new Error(message)\n }\n\n const toolPath = await this.buildAgent.cacheToolDirectory(tempDirectory, toolName, semverVersion)\n this.buildAgent.debug(`Cached tool path: ${toolPath}`)\n this.buildAgent.debug(`Cleaning up temp directory: ${tempDirectory}`)\n await this.buildAgent.removeDirectory(tempDirectory)\n\n return toolPath\n }\n\n async createTempDirectory(): Promise {\n const tempRootDir = this.buildAgent.tempDir\n if (!tempRootDir) {\n throw new Error('Temp directory not set')\n }\n\n const uuid = crypto.randomUUID()\n const tempPath = path.join(tempRootDir, uuid)\n this.buildAgent.debug(`Creating temp directory ${tempPath}`)\n await fs.mkdir(tempPath, { recursive: true })\n return tempPath\n }\n\n private isExplicitVersion(versionSpec: string): boolean {\n const cleanedVersionSpec = semver.clean(versionSpec)\n const valid = semver.valid(cleanedVersionSpec) != null\n this.buildAgent.debug(`Is version explicit? ${valid}`)\n\n return valid\n }\n}\n","import { type IBuildAgent } from '@agents/common'\nimport { type SetupSettings } from './models'\n\nexport interface ISettingsProvider {\n getSetupSettings(): SetupSettings\n}\n\nexport class SettingsProvider implements ISettingsProvider {\n constructor(protected buildAgent: IBuildAgent) {}\n\n getSetupSettings(): SetupSettings {\n const versionSpec = this.buildAgent.getInput('versionSpec')\n const includePrerelease = this.buildAgent.getBooleanInput('includePrerelease')\n const ignoreFailedSources = this.buildAgent.getBooleanInput('ignoreFailedSources')\n const preferLatestVersion = this.buildAgent.getBooleanInput('preferLatestVersion')\n\n return {\n versionSpec,\n includePrerelease,\n ignoreFailedSources,\n preferLatestVersion\n }\n }\n}\n","export * from './models'\nexport * from './dotnet-tool'\nexport * from './settings'\n\nexport const keysOf = Object.keys as (obj: T) => (keyof T)[]\n","import type { IRunner } from './models.ts'\nimport { ExecResult, IBuildAgent } from '@agents/common'\nimport { IDotnetTool } from './dotnet-tool.ts'\n\nexport abstract class RunnerBase implements IRunner {\n protected abstract tool: IDotnetTool\n\n abstract run(command: string): Promise\n\n protected constructor(protected readonly buildAgent: IBuildAgent) {}\n\n protected disableTelemetry(): void {\n this.buildAgent.info(`Running on: '${this.buildAgent.agentName}'`)\n this.buildAgent.debug('Disabling telemetry')\n this.tool.disableTelemetry()\n }\n\n protected async safeExecute(action: () => Promise, successMessage: string): Promise {\n try {\n this.disableTelemetry()\n const result = await action()\n\n this.buildAgent.info(`${this.tool.toolName} Output:`)\n this.buildAgent.info('-------------------')\n this.buildAgent.info(result.stdout as string)\n this.buildAgent.info('-------------------')\n if (result.code === 0) {\n this.buildAgent.debug(`${this.tool.toolName} succeeded`)\n this.buildAgent.setSucceeded(successMessage, true)\n return result\n } else {\n this.buildAgent.debug(`${this.tool.toolName} failed`)\n this.buildAgent.error(result.stderr as string)\n this.buildAgent.setFailed(result.stderr as string, true)\n return result\n }\n } catch (error) {\n if (error instanceof Error) {\n this.buildAgent.debug(`${this.tool.toolName} failed`)\n this.buildAgent.error(error.message)\n this.buildAgent.setFailed(error.message, true)\n }\n return {\n code: -1,\n error: error as Error\n }\n }\n }\n}\n"],"names":["semver.clean","semver.satisfies","semver.maxSatisfying","semver.valid"],"mappings":";;;;;;AAkBO,MAAe,UAAkC,CAAA;AAAA,EAGpD,YAAsB,UAAyB,EAAA;AAAzB,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AAAA;AAA0B,EAFhD,OAAwB,SAAoB,GAAA,0CAAA;AAAA,EAc5C,gBAAyB,GAAA;AACrB,IAAK,IAAA,CAAA,UAAA,CAAW,KAAK,mBAAmB,CAAA;AACxC,IAAK,IAAA,CAAA,UAAA,CAAW,WAAY,CAAA,6BAAA,EAA+B,MAAM,CAAA;AACjE,IAAK,IAAA,CAAA,UAAA,CAAW,WAAY,CAAA,eAAA,EAAiB,MAAM,CAAA;AAAA;AACvD,EAEA,MAAM,OAA2B,GAAA;AAC7B,IAAA,MAAM,gBAAgB,MAAM,IAAA,CAAK,UAAW,CAAA,KAAA,CAAM,UAAU,IAAI,CAAA;AAChE,IAAA,IAAA,CAAK,UAAW,CAAA,KAAA,CAAM,CAAc,WAAA,EAAA,aAAa,CAAE,CAAA,CAAA;AACnD,IAAA,MAAM,KAAK,aAAc,EAAA;AAEzB,IAAM,MAAA,aAAA,GAAgB,IAAK,CAAA,gBAAA,CAAiB,gBAAiB,EAAA;AAE7D,IAAA,IAAI,UAAyBA,mBAAO,CAAM,aAAc,CAAA,WAAW,KAAK,aAAc,CAAA,WAAA;AACtF,IAAK,IAAA,CAAA,UAAA,CAAW,KAAK,4BAA4B,CAAA;AACjD,IAAA,IAAA,CAAK,WAAW,IAAK,CAAA,CAAA,UAAA,EAAa,KAAK,WAAW,CAAA,mBAAA,EAAsB,OAAO,CAAE,CAAA,CAAA;AACjF,IAAK,IAAA,CAAA,UAAA,CAAW,KAAK,4BAA4B,CAAA;AAEjD,IAAA,IAAI,CAAC,IAAA,CAAK,iBAAkB,CAAA,OAAO,CAAG,EAAA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AA;AACH,QAAA,IAAA,CAAK,WAAW,KAAM,CAAA,CAAA,EAAG,IAAK,CAAA,IAAA,CAAK,QAAQ,CAAS,OAAA,CAAA,CAAA;AACpD,QAAK,IAAA,CAAA,UAAA,CAAW,KAAM,CAAA,MAAA,CAAO,MAAgB,CAAA;AAC7C,QAAA,IAAA,CAAK,UAAW,CAAA,SAAA,CAAU,MAAO,CAAA,MAAA,EAAkB,IAAI,CAAA;AACvD,QAAO,OAAA,MAAA;AAAA;AACX,aACK,KAAO,EAAA;AACZ,MAAA,IAAI,iBAAiB,KAAO,EAAA;AACxB,QAAA,IAAA,CAAK,WAAW,KAAM,CAAA,CAAA,EAAG,IAAK,CAAA,IAAA,CAAK,QAAQ,CAAS,OAAA,CAAA,CAAA;AACpD,QAAK,IAAA,CAAA,UAAA,CAAW,KAAM,CAAA,KAAA,CAAM,OAAO,CAAA;AACnC,QAAA,IAAA,CAAK,UAAW,CAAA,SAAA,CAAU,KAAM,CAAA,OAAA,EAAS,IAAI,CAAA;AAAA;AAEjD,MAAO,OAAA;AAAA,QACH,IAAM,EAAA,CAAA,CAAA;AAAA,QACN;AAAA,OACJ;AAAA;AACJ;AAER;;;;"} \ No newline at end of file +{"version":3,"file":"tools.mjs","sources":["../../../src/tools/common/dotnet-tool.ts","../../../src/tools/common/settings.ts","../../../src/tools/common/index.ts","../../../src/tools/common/runner.ts"],"sourcesContent":["import * as crypto from 'node:crypto'\nimport * as fs from 'node:fs/promises'\nimport * as os from 'node:os'\nimport * as path from 'node:path'\n\nimport * as semver from 'semver'\nimport { type IBuildAgent, type ExecResult } from '@agents/common'\nimport { ISettingsProvider } from './settings'\nimport { NugetVersions } from './models'\n\nexport interface IDotnetTool {\n toolName: string\n\n disableTelemetry(): void\n\n install(): Promise\n}\n\nexport abstract class DotnetTool implements IDotnetTool {\n private static readonly nugetRoot: string = 'https://azuresearch-usnc.nuget.org/query'\n\n constructor(protected buildAgent: IBuildAgent) {}\n\n abstract get packageName(): string\n\n abstract get toolName(): string\n\n abstract get toolPathVariable(): string\n\n abstract get versionRange(): string | null\n\n abstract get settingsProvider(): ISettingsProvider\n\n disableTelemetry(): void {\n this.buildAgent.info('Disable Telemetry')\n this.buildAgent.setVariable('DOTNET_CLI_TELEMETRY_OPTOUT', 'true')\n this.buildAgent.setVariable('DOTNET_NOLOGO', 'true')\n }\n\n async install(): Promise {\n const dotnetExePath = await this.buildAgent.which('dotnet', true)\n this.buildAgent.debug(`whichPath: ${dotnetExePath}`)\n await this.setDotnetRoot()\n\n const setupSettings = this.settingsProvider.getSetupSettings()\n\n let version: string | null = semver.clean(setupSettings.versionSpec) || setupSettings.versionSpec\n this.buildAgent.info('--------------------------')\n this.buildAgent.info(`Acquiring ${this.packageName} for version spec: ${version}`)\n this.buildAgent.info('--------------------------')\n\n if (!this.isExplicitVersion(version)) {\n version = await this.queryLatestMatch(this.packageName, version, setupSettings.includePrerelease)\n if (!version) {\n throw new Error(`Unable to find ${this.packageName} version '${version}'.`)\n }\n }\n\n if (this.versionRange && !semver.satisfies(version, this.versionRange, { includePrerelease: setupSettings.includePrerelease })) {\n throw new Error(\n `Version spec '${setupSettings.versionSpec}' resolved as '${version}' does not satisfy the range '${this.versionRange}'.` +\n 'See https://github.com/GitTools/actions/blob/main/docs/versions.md for more information.'\n )\n }\n\n let toolPath: string | null = null\n if (!setupSettings.preferLatestVersion) {\n // Let's try and resolve the version locally first\n toolPath = await this.buildAgent.findLocalTool(this.packageName, version)\n if (toolPath) {\n this.buildAgent.info('--------------------------')\n this.buildAgent.info(`${this.packageName} version: ${version} found in local cache at ${toolPath}.`)\n this.buildAgent.info('--------------------------')\n }\n }\n\n if (!toolPath) {\n // Download, extract, cache\n toolPath = await this.installTool(this.packageName, version, setupSettings.ignoreFailedSources)\n this.buildAgent.info('--------------------------')\n this.buildAgent.info(`${this.packageName} version: ${version} installed.`)\n this.buildAgent.info('--------------------------')\n }\n\n // Prepend the tool's path. This prepends the PATH for the current process and\n // instructs the agent to prepend for each task that follows.\n this.buildAgent.info(`Prepending ${toolPath} to PATH`)\n this.buildAgent.addPath(toolPath)\n\n const pathVariable = this.toolPathVariable\n this.buildAgent.info(`Set ${pathVariable} to ${toolPath}`)\n this.buildAgent.setVariable(pathVariable, toolPath)\n this.buildAgent.setSucceeded(`${this.toolName} installed successfully`, true)\n\n return toolPath\n }\n\n protected async execute(cmd: string, args: string[]): Promise {\n this.buildAgent.info(`Command: ${cmd} ${args.join(' ')}`)\n return await this.buildAgent.exec(cmd, args)\n }\n\n protected async setDotnetRoot(): Promise {\n if (os.platform() !== 'win32' && !this.buildAgent.getVariable('DOTNET_ROOT')) {\n let dotnetPath = await this.buildAgent.which('dotnet', true)\n\n const stats = await fs.lstat(dotnetPath)\n if (stats.isSymbolicLink()) {\n dotnetPath = (await fs.readlink(dotnetPath)) || dotnetPath\n }\n const dotnetRoot = path.dirname(dotnetPath)\n this.buildAgent.setVariable('DOTNET_ROOT', dotnetRoot)\n }\n }\n\n protected async executeTool(args: string[]): Promise {\n let toolPath: string | undefined\n const variableAsPath = this.buildAgent.getVariableAsPath(this.toolPathVariable)\n if (variableAsPath) {\n toolPath = path.join(variableAsPath, os.platform() === 'win32' ? `${this.toolName}.exe` : this.toolName)\n }\n if (!toolPath) {\n toolPath = await this.buildAgent.which(this.toolName, true)\n }\n\n args = ['--roll-forward Major', ...args]\n return await this.execute(toolPath, args)\n }\n\n protected async isValidInputFile(input: string, file: string): Promise {\n return this.filePathSupplied(input) && (await this.buildAgent.fileExists(file))\n }\n\n protected filePathSupplied(file: string): boolean {\n const pathValue = path.resolve(this.buildAgent.getInput(file) || '')\n const repoRoot = this.buildAgent.sourceDir\n return pathValue !== repoRoot\n }\n\n protected async getRepoPath(targetPath: string): Promise {\n const srcDir = this.buildAgent.sourceDir || '.'\n let workDir: string\n if (!targetPath) {\n workDir = srcDir\n } else {\n if (await this.buildAgent.directoryExists(targetPath)) {\n workDir = targetPath\n } else {\n throw new Error(`Directory not found at ${targetPath}`)\n }\n }\n return workDir.replace(/\\\\/g, '/')\n }\n\n private async queryLatestMatch(toolName: string, versionSpec: string, includePrerelease: boolean): Promise {\n this.buildAgent.info(\n `Querying tool versions for ${toolName}${versionSpec ? `@${versionSpec}` : ''} ${includePrerelease ? 'including pre-releases' : ''}`\n )\n\n const toolNameParam = encodeURIComponent(toolName.toLowerCase())\n const prereleaseParam = includePrerelease ? 'true' : 'false'\n const downloadPath = `${DotnetTool.nugetRoot}?q=${toolNameParam}&prerelease=${prereleaseParam}&semVerLevel=2.0.0&take=1`\n\n const response = await fetch(downloadPath)\n\n if (!response || !response.ok) {\n this.buildAgent.info(`failed to query latest version for ${toolName} from ${downloadPath}. Status code: ${response ? response.status : 'unknown'}`)\n return null\n }\n\n const { data } = (await response.json()) as NugetVersions\n\n const versions = data[0].versions.map(x => x.version)\n if (!versions || !versions.length) {\n return null\n }\n\n this.buildAgent.debug(`got versions: ${versions.join(', ')}`)\n\n const version = semver.maxSatisfying(versions, versionSpec, { includePrerelease })\n if (version) {\n this.buildAgent.info(`Found matching version: ${version}`)\n } else {\n this.buildAgent.info('match not found')\n }\n\n return version\n }\n\n private async installTool(toolName: string, version: string, ignoreFailedSources: boolean): Promise {\n const semverVersion = semver.clean(version)\n if (!semverVersion) {\n throw new Error(`Invalid version spec: ${version}`)\n }\n\n const tempDirectory = await this.createTempDirectory()\n\n if (!tempDirectory) {\n throw new Error('Unable to create temp directory')\n }\n\n const args = ['tool', 'install', toolName, '--tool-path', tempDirectory, '--version', semverVersion]\n if (ignoreFailedSources) {\n args.push('--ignore-failed-sources')\n }\n\n const result = await this.execute('dotnet', args)\n const status = result.code === 0 ? 'success' : 'failure'\n const message = result.code === 0 ? result.stdout : result.stderr\n\n this.buildAgent.debug(`Tool install result: ${status} ${message}`)\n\n if (result.code !== 0) {\n throw new Error(message)\n }\n\n const toolPath = await this.buildAgent.cacheToolDirectory(tempDirectory, toolName, semverVersion)\n this.buildAgent.debug(`Cached tool path: ${toolPath}`)\n this.buildAgent.debug(`Cleaning up temp directory: ${tempDirectory}`)\n await this.buildAgent.removeDirectory(tempDirectory)\n\n return toolPath\n }\n\n async createTempDirectory(): Promise {\n const tempRootDir = this.buildAgent.tempDir\n if (!tempRootDir) {\n throw new Error('Temp directory not set')\n }\n\n const uuid = crypto.randomUUID()\n const tempPath = path.join(tempRootDir, uuid)\n this.buildAgent.debug(`Creating temp directory ${tempPath}`)\n await fs.mkdir(tempPath, { recursive: true })\n return tempPath\n }\n\n private isExplicitVersion(versionSpec: string): boolean {\n const cleanedVersionSpec = semver.clean(versionSpec)\n const valid = semver.valid(cleanedVersionSpec) != null\n this.buildAgent.debug(`Is version explicit? ${valid}`)\n\n return valid\n }\n}\n","import { type IBuildAgent } from '@agents/common'\nimport { type SetupSettings } from './models'\n\nexport interface ISettingsProvider {\n getSetupSettings(): SetupSettings\n}\n\nexport class SettingsProvider implements ISettingsProvider {\n constructor(protected buildAgent: IBuildAgent) {}\n\n getSetupSettings(): SetupSettings {\n const versionSpec = this.buildAgent.getInput('versionSpec')\n const includePrerelease = this.buildAgent.getBooleanInput('includePrerelease')\n const ignoreFailedSources = this.buildAgent.getBooleanInput('ignoreFailedSources')\n const preferLatestVersion = this.buildAgent.getBooleanInput('preferLatestVersion')\n\n return {\n versionSpec,\n includePrerelease,\n ignoreFailedSources,\n preferLatestVersion\n }\n }\n}\n","export * from './models'\nexport * from './dotnet-tool'\nexport * from './settings'\n\nexport const keysOf = Object.keys as (obj: T) => (keyof T)[]\n","import type { IRunner } from './models.ts'\nimport { ExecResult, IBuildAgent } from '@agents/common'\nimport { IDotnetTool } from './dotnet-tool.ts'\n\nexport abstract class RunnerBase implements IRunner {\n protected abstract tool: IDotnetTool\n\n abstract run(command: string): Promise\n\n protected constructor(protected readonly buildAgent: IBuildAgent) {}\n\n protected disableTelemetry(): void {\n this.buildAgent.info(`Running on: '${this.buildAgent.agentName}'`)\n this.buildAgent.debug('Disabling telemetry')\n this.tool.disableTelemetry()\n }\n\n protected async safeExecute(action: () => Promise, successMessage: string): Promise {\n try {\n this.disableTelemetry()\n const result = await action()\n\n this.buildAgent.info(`${this.tool.toolName} Output:`)\n this.buildAgent.info('-------------------')\n this.buildAgent.info(result.stdout as string)\n this.buildAgent.info('-------------------')\n if (result.code === 0) {\n this.buildAgent.debug(`${this.tool.toolName} succeeded`)\n this.buildAgent.setSucceeded(successMessage, true)\n return result\n } else {\n this.buildAgent.debug(`${this.tool.toolName} failed`)\n this.buildAgent.error(result.stderr as string)\n this.buildAgent.setFailed(result.stderr as string, true)\n return result\n }\n } catch (error) {\n if (error instanceof Error) {\n this.buildAgent.debug(`${this.tool.toolName} failed`)\n this.buildAgent.error(error.message)\n this.buildAgent.setFailed(error.message, true)\n }\n return {\n code: -1,\n error: error as Error\n }\n }\n }\n}\n"],"names":["semver.clean","semver.satisfies","semver.maxSatisfying","semver.valid"],"mappings":";;;;;;AAkBO,MAAe,UAAkC,CAAA;AAAA,EAGpD,YAAsB,UAAyB,EAAA;AAAzB,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AAAA;AAA0B,EAFhD,OAAwB,SAAoB,GAAA,0CAAA;AAAA,EAc5C,gBAAyB,GAAA;AACrB,IAAK,IAAA,CAAA,UAAA,CAAW,KAAK,mBAAmB,CAAA;AACxC,IAAK,IAAA,CAAA,UAAA,CAAW,WAAY,CAAA,6BAAA,EAA+B,MAAM,CAAA;AACjE,IAAK,IAAA,CAAA,UAAA,CAAW,WAAY,CAAA,eAAA,EAAiB,MAAM,CAAA;AAAA;AACvD,EAEA,MAAM,OAA2B,GAAA;AAC7B,IAAA,MAAM,gBAAgB,MAAM,IAAA,CAAK,UAAW,CAAA,KAAA,CAAM,UAAU,IAAI,CAAA;AAChE,IAAA,IAAA,CAAK,UAAW,CAAA,KAAA,CAAM,CAAc,WAAA,EAAA,aAAa,CAAE,CAAA,CAAA;AACnD,IAAA,MAAM,KAAK,aAAc,EAAA;AAEzB,IAAM,MAAA,aAAA,GAAgB,IAAK,CAAA,gBAAA,CAAiB,gB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/tools/common/dotnet-tool.ts index e11e48ab6..702f73429 100644 --- a/src/tools/common/dotnet-tool.ts +++ b/src/tools/common/dotnet-tool.ts @@ -122,6 +122,8 @@ export abstract class DotnetTool implements IDotnetTool { if (!toolPath) { toolPath = await this.buildAgent.which(this.toolName, true) } + + args = ['--roll-forward Major', ...args] return await this.execute(toolPath, args) }