From 838d250642bf493258c64b42d01468c9716f4b55 Mon Sep 17 00:00:00 2001 From: Jiri Malak Date: Tue, 26 Mar 2024 19:10:57 +0100 Subject: [PATCH] change default location to install Open Watcom to /watcom it is always writeble subdirectory for all used hosts add experimental OSX 64-bit Intel and ARM binaries to enable use of OW cross-compilation on OSX to OW supported target (by example for DOS etc.) --- .github/workflows/build_test_release.yml | 5 +++++ action.yml | 2 +- src/main.ts | 24 ++++++++++++++++++------ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_test_release.yml b/.github/workflows/build_test_release.yml index 36c9056..54d545d 100644 --- a/.github/workflows/build_test_release.yml +++ b/.github/workflows/build_test_release.yml @@ -35,6 +35,11 @@ jobs: - "1.9" - "2.0" - "2.0-64" + include: + - runner: macos-latest + version: "2.0-64" + - runner: macos-14 + version: "2.0-64" steps: - name: Download artifact uses: actions/download-artifact@v4 diff --git a/action.yml b/action.yml index ff6d517..ab731d8 100644 --- a/action.yml +++ b/action.yml @@ -13,7 +13,7 @@ inputs: required: false default: '' location: - description: 'Location where Open Watcom should be extracted to (default=/opt/watcom or C:\\WATCOM)' + description: 'Location where Open Watcom should be extracted to (default=$HOME/watcom or %USERPROFILE%\\WATCOM)' required: false default: '' environment: diff --git a/src/main.ts b/src/main.ts index fa7774a..5ce39a5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -50,11 +50,9 @@ function getInputs(): ISetupWatcomSettings { throw new Error("Unsupported version"); } - let default_location: string; let p_path_subdir: string; let p_inc_subdirs: string[]; if (process.platform === "win32") { - default_location = "C:\\WATCOM"; if (p_version == "2.0-64") { p_path_subdir = "BINNT64"; } else { @@ -62,9 +60,18 @@ function getInputs(): ISetupWatcomSettings { } p_inc_subdirs = ["H", "H\\NT", "H\\NT\\DIRECTX", "H\\NT\\DDK"]; } else if (process.platform === "darwin") { - throw new Error("Unsupported platform"); + if (p_version !== "2.0-64") { + throw new Error("Unsupported platform"); + } + if (process.arch === 'arm64') { + p_path_subdir = "armo64"; + } else if (process.arch === 'x64') { + p_path_subdir = "bino64"; + } else { + throw new Error("Unsupported platform"); + } + p_inc_subdirs = ["lh"]; } else { - default_location = "/opt/watcom"; if (p_version == "2.0-64") { p_path_subdir = "binl64"; } else { @@ -72,10 +79,15 @@ function getInputs(): ISetupWatcomSettings { } p_inc_subdirs = ["lh"]; } - let p_location = core.getInput("location"); if (!p_location) { - p_location = default_location; + if (process.platform === "win32") { + const home_path = process.env["USERPROFILE"] + ""; + p_location = path.join(home_path, "WATCOM"); + } else { + const home_path = process.env["HOME"] + ""; + p_location = path.join(home_path, "watcom"); + } } const p_environment = core.getBooleanInput("environment");