Skip to content

Commit

Permalink
Adding arm64 detection
Browse files Browse the repository at this point in the history
  • Loading branch information
timheuer committed Nov 7, 2022
1 parent 0b44c67 commit 1bba226
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,18 @@ jobs:
vs-prerelease: true
msbuild-architecture: 'x64'

- name: Setup MSBuild (arm64)
id: setup_msbuild_path_arm
uses: ./
with:
vs-prerelease: true
msbuild-architecture: 'arm64'

- name: echo msbuild path
run: |
echo "vswhere-path: ${{ steps.setup_msbuild_explicit.outputs.msbuildPath }}"
echo "PATH: ${{ steps.setup_msbuild_path.outputs.msbuildPath }}"
echo "ARM PATH: ${{ steps.setup_msbuild_path_arm.outputs.msbuildPath }}"
echo "Fallback: ${{ steps.setup_msbuild_fallback.outputs.msbuildPath }}"
- name: echo MSBuild
Expand Down
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1701,9 +1701,9 @@ function run() {
stdout: (data) => {
const installationPath = data.toString().trim();
core.debug(`Found installation path: ${installationPath}`);
// x64 only exists in one possible location, so no fallback probing
if (MSBUILD_ARCH === "x64") {
let toolPath = path.join(installationPath, 'MSBuild\\Current\\Bin\\amd64\\MSBuild.exe');
// x64 and arm64 only exist in one possible location, so no fallback probing
if (MSBUILD_ARCH === 'x64' || MSBUILD_ARCH === 'arm64') {
let toolPath = path.join(installationPath, 'MSBuild\\Current\\Bin\\${MSBUILD_ARCH}\\MSBuild.exe');
core.debug(`Checking for path: ${toolPath}`);
if (!fs.existsSync(toolPath)) {
return;
Expand Down
8 changes: 4 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ async function run(): Promise<void> {
const installationPath = data.toString().trim()
core.debug(`Found installation path: ${installationPath}`)

// x64 only exists in one possible location, so no fallback probing
if (MSBUILD_ARCH === "x64") {
// x64 and arm64 only exist in one possible location, so no fallback probing
if (MSBUILD_ARCH === 'x64' || MSBUILD_ARCH === 'arm64') {
let toolPath = path.join(
installationPath,
'MSBuild\\Current\\Bin\\amd64\\MSBuild.exe'
);
'MSBuild\\Current\\Bin\\${MSBUILD_ARCH}\\MSBuild.exe'
)
core.debug(`Checking for path: ${toolPath}`)
if (!fs.existsSync(toolPath)) {
return
Expand Down

0 comments on commit 1bba226

Please # to comment.