Compare commits

..

5 Commits
v1.2 ... v1.3.1

Author SHA1 Message Date
1ff57057b5 Added action-types 2023-02-03 15:02:07 -08:00
0e7c76c8f5 Merge pull request #110 from Vampire/issue-109 [skip ci]
Implement #109 adding action types file and fixes #111 as well
2023-02-03 08:46:55 -08:00
3ac564e2a5 Implement #109 adding action types file 2023-02-03 17:43:05 +01:00
d3ea839497 Version bump 2022-12-13 08:12:09 -08:00
0a09b7fae9 Fixes #104 reassigning input arg [skip ci] 2022-12-13 08:07:05 -08:00
6 changed files with 32 additions and 6 deletions

18
action-types.yml Normal file
View File

@ -0,0 +1,18 @@
# See https://github.com/krzema12/github-actions-typing
inputs:
vswhere-path:
type: string
vs-version:
type: string
vs-prerelease:
type: boolean
msbuild-architecture:
type: enum
name: Architecture
allowed-values:
- x86
- x64
- arm64
outputs:
msbuildPath:
type: string

View File

@ -15,7 +15,7 @@ inputs:
description: 'Enable searching for pre-release versions of Visual Studio/MSBuild' description: 'Enable searching for pre-release versions of Visual Studio/MSBuild'
required: false required: false
msbuild-architecture: msbuild-architecture:
description: 'The preferred processor architecture of MSBuild. Can be either "x86" or "x64". "x64" is only available from Visual Studio version 17.0 and later.' description: 'The preferred processor architecture of MSBuild. Can be either "x86", "x64", or "arm64". "x64" is only available from Visual Studio version 17.0 and later.'
required: false required: false
default: 'x86' default: 'x86'
outputs: outputs:

6
dist/index.js vendored
View File

@ -1652,7 +1652,7 @@ const IS_WINDOWS = process.platform === 'win32';
const VS_VERSION = core.getInput('vs-version') || 'latest'; const VS_VERSION = core.getInput('vs-version') || 'latest';
const VSWHERE_PATH = core.getInput('vswhere-path'); const VSWHERE_PATH = core.getInput('vswhere-path');
const ALLOW_PRERELEASE = core.getInput('vs-prerelease') || 'false'; const ALLOW_PRERELEASE = core.getInput('vs-prerelease') || 'false';
const MSBUILD_ARCH = core.getInput('msbuild-architecture') || 'x86'; let MSBUILD_ARCH = core.getInput('msbuild-architecture') || 'x86';
// if a specific version of VS is requested // if a specific version of VS is requested
let VSWHERE_EXEC = '-products * -requires Microsoft.Component.MSBuild -property installationPath -latest '; let VSWHERE_EXEC = '-products * -requires Microsoft.Component.MSBuild -property installationPath -latest ';
if (ALLOW_PRERELEASE === 'true') { if (ALLOW_PRERELEASE === 'true') {
@ -1703,6 +1703,10 @@ function run() {
core.debug(`Found installation path: ${installationPath}`); core.debug(`Found installation path: ${installationPath}`);
// x64 and arm64 only exist in one possible location, so no fallback probing // x64 and arm64 only exist in one possible location, so no fallback probing
if (MSBUILD_ARCH === 'x64' || MSBUILD_ARCH === 'arm64') { if (MSBUILD_ARCH === 'x64' || MSBUILD_ARCH === 'arm64') {
// x64 is actually amd64 so change to that
if (MSBUILD_ARCH === 'x64') {
MSBUILD_ARCH = 'amd64';
}
let toolPath = path.join(installationPath, `MSBuild\\Current\\Bin\\${MSBUILD_ARCH}\\MSBuild.exe`); let toolPath = path.join(installationPath, `MSBuild\\Current\\Bin\\${MSBUILD_ARCH}\\MSBuild.exe`);
core.debug(`Checking for path: ${toolPath}`); core.debug(`Checking for path: ${toolPath}`);
if (!fs.existsSync(toolPath)) { if (!fs.existsSync(toolPath)) {

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "setup-msbuild", "name": "setup-msbuild",
"version": "1.2.0", "version": "1.3.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "setup-msbuild", "name": "setup-msbuild",
"version": "1.2.0", "version": "1.3.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.10.0", "@actions/core": "^1.10.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "setup-msbuild", "name": "setup-msbuild",
"version": "1.2.0", "version": "1.3.1",
"private": true, "private": true,
"description": "Helps set up specific MSBuild tool into PATH for later usage.", "description": "Helps set up specific MSBuild tool into PATH for later usage.",
"main": "lib/main.js", "main": "lib/main.js",

View File

@ -9,7 +9,7 @@ const IS_WINDOWS = process.platform === 'win32'
const VS_VERSION = core.getInput('vs-version') || 'latest' const VS_VERSION = core.getInput('vs-version') || 'latest'
const VSWHERE_PATH = core.getInput('vswhere-path') const VSWHERE_PATH = core.getInput('vswhere-path')
const ALLOW_PRERELEASE = core.getInput('vs-prerelease') || 'false' const ALLOW_PRERELEASE = core.getInput('vs-prerelease') || 'false'
const MSBUILD_ARCH = core.getInput('msbuild-architecture') || 'x86' let MSBUILD_ARCH = core.getInput('msbuild-architecture') || 'x86'
// if a specific version of VS is requested // if a specific version of VS is requested
let VSWHERE_EXEC = '-products * -requires Microsoft.Component.MSBuild -property installationPath -latest ' let VSWHERE_EXEC = '-products * -requires Microsoft.Component.MSBuild -property installationPath -latest '
@ -73,6 +73,10 @@ async function run(): Promise<void> {
// x64 and arm64 only exist in one possible location, so no fallback probing // x64 and arm64 only exist in one possible location, so no fallback probing
if (MSBUILD_ARCH === 'x64' || MSBUILD_ARCH === 'arm64') { if (MSBUILD_ARCH === 'x64' || MSBUILD_ARCH === 'arm64') {
// x64 is actually amd64 so change to that
if (MSBUILD_ARCH === 'x64') {
MSBUILD_ARCH = 'amd64'
}
let toolPath = path.join( let toolPath = path.join(
installationPath, installationPath,
`MSBuild\\Current\\Bin\\${MSBUILD_ARCH}\\MSBuild.exe` `MSBuild\\Current\\Bin\\${MSBUILD_ARCH}\\MSBuild.exe`