Skip to content

Commit 6908737

Browse files
authored
Merge pull request #159 from aminya/rename [skip ci]
2 parents 60b884b + 0c06ab6 commit 6908737

25 files changed

+123
-114
lines changed

.github/workflows/CI.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ jobs:
103103
gzip: folders
104104
draft: true
105105
files: >
106-
./exe/setup_cpp_windows.exe
107-
./exe/setup_cpp_linux
108-
./exe/setup_cpp_mac
109-
./dist/node12/setup_cpp.js
110-
./dist/node12/setup_cpp.js.map
106+
./exe/setup-cpp-x64-windows.exe
107+
./exe/setup-cpp-x64-linux
108+
./exe/setup-cpp-x64-macos
109+
./dist/node12/setup-cpp.js
110+
./dist/node12/setup-cpp.js.map
111111
./dist/node12/
112112
./dist/node16/
113113
@@ -161,4 +161,4 @@ jobs:
161161
- name: Build
162162
id: docker_build
163163
run: |
164-
docker build -f ./dev/docker/${{ matrix.container }} -t setup_cpp .
164+
docker build -f ./dev/docker/${{ matrix.container }} -t setup-cpp .

README.md

Lines changed: 54 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -30,69 +30,68 @@ Setting up a **cross-platform** environment for building and testing C++/C proje
3030

3131
### From Terminal
3232

33-
You should download the executable file or the js file (if Nodejs installed), and run it with the available options.
33+
#### With npm and Nodejs
3434

35-
Tip: You can automate downloading using `wget`, `curl`, or other similar tools.
36-
37-
#### Executable
38-
39-
Download the executable for your platform from [here](https://github.com/aminya/setup-cpp/releases/tag/v0.25.1), and run it with the available options.
40-
41-
An example that installs llvm, cmake, ninja, ccache, and vcpkg:
42-
43-
```ps1
44-
# windows example (open shell as admin)
45-
curl.exe -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_windows.exe"
46-
.\setup_cpp_windows --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
35+
Install setup-cpp with npm:
4736

48-
RefreshEnv.cmd # activate cpp environment variables
37+
```shell
38+
npm install -g setup-cpp
4939
```
5040

51-
```ps1
52-
# linux example
53-
wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_linux"
54-
chmod +x setup_cpp_linux
55-
sudo ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
41+
Then run `setup-cpp` with the available options.
5642

57-
source ~/.cpprc # activate cpp environment variables
43+
```shell
44+
# windows example (open PowerShell as admin)
45+
setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
46+
47+
RefreshEnv.cmd # activate the environment
5848
```
5949

60-
```ps1
61-
# mac example
62-
wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_mac"
63-
chmod +x setup_cpp_mac
64-
sudo ./setup_cpp_mac --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
50+
```shell
51+
# linux/macos example
52+
sudo setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
6553

66-
source ~/.cpprc # activate cpp environment variables
54+
source ~/.cpprc
6755
```
6856

6957
NOTE: In the `compiler` entry, you can specify the version after `-` like `llvm-11.0.0`. For the tools, you can pass a specific version instead of `true` that chooses the default version
7058

7159
NOTE: On Unix systems, when `setup-cpp` is used locally or in other CI services like GitLab, the environment variables are added to `~/.cpprc`. You should run `source ~/.cpprc` to immediately activate the environment variables. This file is automatically sourced in the next shell restart from `~/.bashrc` or `~/.profile` if `SOURCE_CPPRC` is not set to `0`. To deactivate `.cpprc` in the next shell restart, rename/remove `~/.cpprc`.
7260

73-
NOTE: On Unix systems, you will not need `sudo` if you are already a root user (e.g., in a GitLab runner or Docker).
61+
NOTE: On Unix systems, if you are already a root user (e.g., in a GitLab runner or Docker), you will not need to use `sudo`.
7462

75-
#### With Nodejs
63+
#### With executable
7664

77-
Download the `setup_cpp.js` file form [here](https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp.js), and run it with the available options.
65+
You can download a self-contained executable file and run it with the available options.
7866

79-
On Windows:
67+
Download the executable for your platform from [here](https://github.com/aminya/setup-cpp/releases/tag/v0.25.1), and run it with the available options.
68+
69+
Tip: You can automate downloading using `wget`, `curl`, or other similar tools.
8070

81-
Open the shell as admin, download via `curl`, then install
71+
An example that installs llvm, cmake, ninja, ccache, and vcpkg:
8272

83-
```ps1
84-
# open shell as admin
85-
curl.exe -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp.js"
86-
node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
73+
```shell
74+
# windows example (open PowerShell as admin)
75+
curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-windows.exe"
76+
./setup-cpp-x64-windows --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
8777

8878
RefreshEnv.cmd # activate cpp environment variables
8979
```
9080

91-
On Linux or Mac:
81+
```shell
82+
# linux example
83+
wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-linux"
84+
chmod +x ./setup-cpp-x64-linux
85+
sudo ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
86+
87+
source ~/.cpprc # activate cpp environment variables
88+
```
9289

93-
```ps1
94-
wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp.js"
95-
sudo node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
90+
```shell
91+
# macos example
92+
wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-macos"
93+
chmod +x ./setup-cpp-x64-macos
94+
sudo ./setup-cpp-x64-macos --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
9695

9796
source ~/.cpprc # activate cpp environment variables
9897
```
@@ -160,21 +159,21 @@ jobs:
160159

161160
### Inside Docker
162161

163-
Here is an example for using setup_cpp to make a builder image that has the Cpp tools you need.
162+
Here is an example for using setup-cpp to make a builder image that has the Cpp tools you need.
164163

165164
```dockerfile
166165
#### Base Image
167166
FROM ubuntu:22.04 AS base
168167

169-
# add setup_cpp
168+
# add setup-cpp
170169
WORKDIR "/"
171170
RUN apt-get update -qq
172171
RUN apt-get install -y --no-install-recommends wget
173-
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_linux"
174-
RUN chmod +x ./setup_cpp_linux
172+
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-linux"
173+
RUN chmod +x ./setup-cpp-x64-linux
175174

176175
# install llvm, cmake, ninja, and ccache
177-
RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --make true
176+
RUN ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --make true
178177

179178
CMD source ~/.cpprc
180179
ENTRYPOINT [ "/bin/bash" ]
@@ -199,18 +198,18 @@ See [this folder](https://github.com/aminya/setup-cpp/tree/master/dev/docker), f
199198

200199
If you want to build the ones included, then run:
201200

202-
```ps1
201+
```shell
203202
git clone --recurse-submodules https://github.com/aminya/setup-cpp
204203
cd ./setup-cpp
205-
docker build -f ./dev/docker/ubuntu.dockerfile -t setup_cpp .
204+
docker build -f ./dev/docker/ubuntu.dockerfile -t setup-cpp .
206205
```
207206

208207
Where you should use the path to the dockerfile after `-f`.
209208

210209
After build, run the following to start an interactive shell in your container
211210

212-
```ps1
213-
docker run -it setup_cpp
211+
```shell
212+
docker run -it setup-cpp
214213
```
215214

216215
### Inside Docker inside GitHub Actions
@@ -230,7 +229,7 @@ jobs:
230229
- name: Build
231230
id: docker_build
232231
run: |
233-
docker build -f ./dev/docker/debian.dockerfile -t setup_cpp .
232+
docker build -f ./dev/docker/debian.dockerfile -t setup-cpp .
234233
```
235234
236235
### Inside GitLab pipelines
@@ -261,10 +260,10 @@ stages:
261260
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
262261
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F
263262

264-
.setup_cpp: &setup_cpp |
265-
curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_linux"
266-
chmod +x setup_cpp_linux
267-
./setup_cpp_linux --compiler $compiler --cmake true --ninja true --ccache true --vcpkg true
263+
.setup-cpp: &setup-cpp |
264+
curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-linux"
265+
chmod +x setup-cpp-x64-linux
266+
./setup-cpp-x64-linux --compiler $compiler --cmake true --ninja true --ccache true --vcpkg true
268267
source ~/.cpprc
269268

270269
.test: &test |
@@ -277,7 +276,7 @@ test_linux_llvm:
277276
compiler: llvm
278277
script:
279278
- *setup_linux
280-
- *setup_cpp
279+
- *setup-cpp
281280
- *test
282281

283282
test_linux_gcc:
@@ -286,7 +285,7 @@ test_linux_gcc:
286285
compiler: gcc
287286
script:
288287
- *setup_linux
289-
- *setup_cpp
288+
- *setup-cpp
290289
- *test
291290
```
292291

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ inputs:
8484

8585
runs:
8686
using: "node16"
87-
main: "dist/node16/setup_cpp.js"
87+
main: "dist/node16/setup-cpp.js"
8888

8989
branding:
9090
icon: "award"

dev/docker/arch_node.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ RUN pacman -S --noconfirm --needed nodejs
1010
# curl for downloading setup-cpp
1111
RUN pacman -S --noconfirm --needed curl
1212

13-
# add setup_cpp.js
13+
# add setup-cpp.js
1414
COPY "./dist/node12" "/"
1515
WORKDIR "/"
1616

1717
# run installation
18-
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
18+
RUN node ./setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
1919

2020
# clean up
2121
RUN pacman -Scc --noconfirm

dev/docker/fedora_node.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ RUN dnf -y install nodejs
77
# curl for downloading setup-cpp
88
RUN dnf -y install curl
99

10-
# add setup_cpp.js
10+
# add setup-cpp.js
1111
COPY "./dist/node12" "/"
1212
WORKDIR "/"
1313

1414
# run installation
15-
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true
15+
RUN node ./setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true
1616

1717
# clean up
1818
RUN rm -rf /tmp/*

dev/docker/ubuntu.dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#### Base Image
22
FROM ubuntu:22.04 AS base
33

4-
# add setup_cpp
4+
# add setup-cpp
55
WORKDIR "/"
66
RUN apt-get update -qq
77
RUN apt-get install -y --no-install-recommends wget
8-
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_linux"
9-
RUN chmod +x ./setup_cpp_linux
8+
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-linux"
9+
RUN chmod +x ./setup-cpp-x64-linux
1010

1111
# install llvm, cmake, ninja, and ccache
12-
RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --task true
12+
RUN ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --task true
1313

1414
CMD source ~/.cpprc
1515
ENTRYPOINT [ "/bin/bash" ]

dev/docker/ubuntu_20.04_node.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ RUN apt-get install -y --no-install-recommends curl gnupg ca-certificates
1111
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
1212
RUN apt-get install -y --no-install-recommends nodejs
1313

14-
# add setup_cpp.js
14+
# add setup-cpp.js
1515
COPY "./dist/node12" "/"
1616
WORKDIR "/"
1717

1818
# run installation
19-
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
19+
RUN node ./setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
2020

2121
CMD source ~/.cpprc
2222
ENTRYPOINT [ "/bin/bash" ]

dev/docker/ubuntu_node.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ FROM ubuntu:22.04 AS base
33
RUN apt-get update -qq
44
RUN apt-get install -y --no-install-recommends nodejs
55

6-
# add setup_cpp.js
6+
# add setup-cpp.js
77
COPY "./dist/node12" "/"
88
WORKDIR "/"
99

1010
# run installation
11-
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true
11+
RUN node ./setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true
1212

1313
# clean up
1414
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

dev/scripts/debug_remove.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { join, dirname } = require("path")
55

66
async function main() {
77
console.log("Disabling debug messages inside @actions/core")
8-
const file = join(dirname(__dirname), "dist", "setup_cpp.js")
8+
const file = join(dirname(__dirname), "dist", "setup-cpp.js")
99
const { code, map } = await minify(readFileSync(file, "utf8"), { sourceMap: true, ...require("../.terserrc.js") })
1010

1111
writeFileSync(file, code)

dev/scripts/pack-exe.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function getPlatformName() {
77
return "windows"
88
}
99
case "darwin": {
10-
return "mac"
10+
return "macos"
1111
}
1212
default: {
1313
return process.platform
@@ -31,10 +31,10 @@ function main() {
3131
"--input",
3232
"./dist/node16",
3333
"--output",
34-
`./exe/setup_cpp_${getPlatformName()}${exe}`,
34+
`./exe/setup-cpp-${process.arch}-${getPlatformName()}${exe}`,
3535
"--",
3636
`{{caxa}}/node_modules/.bin/node${exe}`,
37-
`{{caxa}}/setup_cpp.js`,
37+
`{{caxa}}/setup-cpp.js`,
3838
])
3939
)
4040
)

dist/node12/actions_python.e3292b54.js renamed to dist/node12/actions_python.54dac7f6.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node12/actions_python.e3292b54.js.map renamed to dist/node12/actions_python.54dac7f6.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node12/setup_cpp.js renamed to dist/node12/setup-cpp.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node12/setup_cpp.js.map renamed to dist/node12/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node16/actions_python.63cb96cd.js renamed to dist/node16/actions_python.abf6481f.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node16/actions_python.63cb96cd.js.map renamed to dist/node16/actions_python.abf6481f.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node16/setup_cpp.js renamed to dist/node16/setup-cpp.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node16/setup_cpp.js.map renamed to dist/node16/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)