From c41d430d6bf99ca5466402f4f8cd6e7dc10d574e Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 17 Jan 2023 21:50:44 -0800 Subject: [PATCH] fix: rename the built executables to include architecture and use - BREAKING CHANGE the built executables are now renamed to include the architecture. See the readme for more information --- .github/workflows/CI.yml | 6 +++--- README.md | 32 ++++++++++++++++---------------- dev/docker/ubuntu.dockerfile | 6 +++--- dev/scripts/pack-exe.ts | 4 ++-- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 000ee727..bc30bc02 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -103,9 +103,9 @@ jobs: gzip: folders draft: true files: > - ./exe/setup_cpp_windows.exe - ./exe/setup_cpp_linux - ./exe/setup_cpp_mac + ./exe/setup-cpp-x64-windows.exe + ./exe/setup-cpp-x64-linux + ./exe/setup-cpp-x64-macos ./dist/node12/setup-cpp.js ./dist/node12/setup-cpp.js.map ./dist/node12/ diff --git a/README.md b/README.md index 3d2060e5..d90086fc 100644 --- a/README.md +++ b/README.md @@ -41,27 +41,27 @@ Download the executable for your platform from [here](https://github.com/aminya/ An example that installs llvm, cmake, ninja, ccache, and vcpkg: ```ps1 -# windows example (open shell as admin) -curl.exe -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_windows.exe" -.\setup_cpp_windows --compiler llvm --cmake true --ninja true --ccache true --vcpkg true +# windows example (open PowerShell as admin) +curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-windows.exe" +./setup-cpp-x64-windows --compiler llvm --cmake true --ninja true --ccache true --vcpkg true RefreshEnv.cmd # activate cpp environment variables ``` ```ps1 # linux example -wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_linux" -chmod +x setup_cpp_linux -sudo ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true +wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-linux" +chmod +x ./setup-cpp-x64-linux +sudo ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true source ~/.cpprc # activate cpp environment variables ``` ```ps1 -# mac example -wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_mac" -chmod +x setup_cpp_mac -sudo ./setup_cpp_mac --compiler llvm --cmake true --ninja true --ccache true --vcpkg true +# macos example +wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-macos" +chmod +x ./setup-cpp-x64-macos +sudo ./setup-cpp-x64-macos --compiler llvm --cmake true --ninja true --ccache true --vcpkg true source ~/.cpprc # activate cpp environment variables ``` @@ -170,11 +170,11 @@ FROM ubuntu:22.04 AS base WORKDIR "/" RUN apt-get update -qq RUN apt-get install -y --no-install-recommends wget -RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_linux" -RUN chmod +x ./setup_cpp_linux +RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-linux" +RUN chmod +x ./setup-cpp-x64-linux # install llvm, cmake, ninja, and ccache -RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --make true +RUN ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --make true CMD source ~/.cpprc ENTRYPOINT [ "/bin/bash" ] @@ -262,9 +262,9 @@ stages: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F .setup-cpp: &setup-cpp | - curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_linux" - chmod +x setup_cpp_linux - ./setup_cpp_linux --compiler $compiler --cmake true --ninja true --ccache true --vcpkg true + curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-linux" + chmod +x setup-cpp-x64-linux + ./setup-cpp-x64-linux --compiler $compiler --cmake true --ninja true --ccache true --vcpkg true source ~/.cpprc .test: &test | diff --git a/dev/docker/ubuntu.dockerfile b/dev/docker/ubuntu.dockerfile index 345d7345..9badbb75 100644 --- a/dev/docker/ubuntu.dockerfile +++ b/dev/docker/ubuntu.dockerfile @@ -5,11 +5,11 @@ FROM ubuntu:22.04 AS base WORKDIR "/" RUN apt-get update -qq RUN apt-get install -y --no-install-recommends wget -RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_linux" -RUN chmod +x ./setup_cpp_linux +RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-linux" +RUN chmod +x ./setup-cpp-x64-linux # install llvm, cmake, ninja, and ccache -RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --task true +RUN ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --task true CMD source ~/.cpprc ENTRYPOINT [ "/bin/bash" ] diff --git a/dev/scripts/pack-exe.ts b/dev/scripts/pack-exe.ts index 1047bed7..4fb65142 100644 --- a/dev/scripts/pack-exe.ts +++ b/dev/scripts/pack-exe.ts @@ -7,7 +7,7 @@ function getPlatformName() { return "windows" } case "darwin": { - return "mac" + return "macos" } default: { return process.platform @@ -31,7 +31,7 @@ function main() { "--input", "./dist/node16", "--output", - `./exe/setup_cpp_${getPlatformName()}${exe}`, + `./exe/setup-cpp-${process.arch}-${getPlatformName()}${exe}`, "--", `{{caxa}}/node_modules/.bin/node${exe}`, `{{caxa}}/setup-cpp.js`,