Skip to content

Commit f7e3122

Browse files
committed
Merge branch 'master' into pr/135
2 parents 4f46b3e + 460f965 commit f7e3122

38 files changed

+1474
-1174
lines changed

.github/workflows/CI.yml

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- master
77
- main
88
- dev
9+
tags:
10+
- "*"
911

1012
jobs:
1113
Test:
@@ -23,7 +25,7 @@ jobs:
2325
- macos-12
2426
- macos-11
2527
node:
26-
- 14 # installed on the images
28+
- 16
2729
pnpm:
2830
- 7
2931
cache_reset_counter:
@@ -57,29 +59,57 @@ jobs:
5759
run: |
5860
pnpm install
5961
62+
# - name: Setup SSH debugging session
63+
# uses: mxschmitt/action-tmate@v3
64+
65+
- name: Test
66+
if: "!contains(github.event.head_commit.message, '[skip ci test]')"
67+
run: |
68+
pnpm run test
69+
continue-on-error: ${{ contains(matrix.os, 'ubuntu-18.04') }}
70+
6071
# Create self-contained executable that bundles Nodejs
6172
- name: Create Executable
62-
if: "contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-20.04') || contains(matrix.os, 'macos-11')"
73+
if: "contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-22.04') || contains(matrix.os, 'macos-12')"
6374
run: |
6475
pnpm run pack.exe
6576
66-
- name: Upload Executable
67-
if: "contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-20.04') || contains(matrix.os, 'macos-11')"
77+
- name: Upload Artifacts
78+
if: ${{ (startsWith(github.ref, 'refs/tags/')) && contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-22.04') || contains(matrix.os, 'macos-12') }}
6879
uses: actions/upload-artifact@v3
6980
with:
7081
path: |
7182
./exe
7283
./dist
7384
retention-days: 1
7485

75-
# - name: Setup SSH debugging session
76-
# uses: mxschmitt/action-tmate@v3
86+
Release:
87+
needs: Test
88+
if: startsWith(github.ref, 'refs/tags/')
89+
runs-on: ubuntu-22.04
90+
steps:
91+
- name: Download Artifacts
92+
uses: actions/download-artifact@v3
7793

78-
- name: Test
79-
if: "!contains(github.event.head_commit.message, '[skip ci test]')"
94+
- name: Place Artifacts
8095
run: |
81-
pnpm run test
82-
continue-on-error: ${{ contains(matrix.os, 'ubuntu-18.04') }}
96+
mv -v artifact/* ./
97+
chmod +x -R ./exe/
98+
99+
- name: Draft the release
100+
uses: meeDamian/github-release@2.0
101+
with:
102+
token: ${{ secrets.GITHUB_TOKEN }}
103+
gzip: folders
104+
draft: true
105+
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
111+
./dist/node12/
112+
./dist/node16/
83113
84114
Docker:
85115
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip docker]') }}

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ Tip: You can automate downloading using `wget`, `curl`, or other similar tools.
3636

3737
#### Executable
3838

39-
Download the executable for your platform from [here](https://github.com/aminya/setup-cpp/releases/tag/v0.20.1), and run it with the available options.
39+
Download the executable for your platform from [here](https://github.com/aminya/setup-cpp/releases/tag/v0.21.0), and run it with the available options.
4040

4141
An example that installs llvm, cmake, ninja, ccache, and vcpkg:
4242

4343
```ps1
4444
# windows example (open shell as admin)
45-
curl.exe -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.20.1/setup_cpp_windows.exe"
45+
curl.exe -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.21.0/setup_cpp_windows.exe"
4646
.\setup_cpp_windows --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
4747
4848
RefreshEnv.cmd # activate cpp environment variables
4949
```
5050

5151
```ps1
5252
# linux example
53-
wget "https://github.com/aminya/setup-cpp/releases/download/v0.20.1/setup_cpp_linux"
53+
wget "https://github.com/aminya/setup-cpp/releases/download/v0.21.0/setup_cpp_linux"
5454
chmod +x setup_cpp_linux
5555
sudo ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
5656
@@ -59,7 +59,7 @@ source ~/.cpprc # activate cpp environment variables
5959

6060
```ps1
6161
# mac example
62-
wget "https://github.com/aminya/setup-cpp/releases/download/v0.20.1/setup_cpp_mac"
62+
wget "https://github.com/aminya/setup-cpp/releases/download/v0.21.0/setup_cpp_mac"
6363
chmod +x setup_cpp_mac
6464
sudo ./setup_cpp_mac --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
6565
@@ -74,15 +74,15 @@ NOTE: On Unix systems, you will not need `sudo` if you are already a root user (
7474

7575
#### With Nodejs
7676

77-
Download the `setup_cpp.js` file form [here](https://github.com/aminya/setup-cpp/releases/download/v0.20.1/setup_cpp.js), and run it with the available options.
77+
Download the `setup_cpp.js` file form [here](https://github.com/aminya/setup-cpp/releases/download/v0.21.0/setup_cpp.js), and run it with the available options.
7878

7979
On Windows:
8080

8181
Open the shell as admin, download via `curl`, then install
8282

8383
```ps1
8484
# open shell as admin
85-
curl.exe -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.20.1/setup_cpp.js"
85+
curl.exe -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.21.0/setup_cpp.js"
8686
node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
8787
8888
RefreshEnv.cmd # activate cpp environment variables
@@ -91,7 +91,7 @@ RefreshEnv.cmd # activate cpp environment variables
9191
On Linux or Mac:
9292

9393
```ps1
94-
wget "https://github.com/aminya/setup-cpp/releases/download/v0.20.1/setup_cpp.js"
94+
wget "https://github.com/aminya/setup-cpp/releases/download/v0.21.0/setup_cpp.js"
9595
sudo node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
9696
9797
source ~/.cpprc # activate cpp environment variables
@@ -170,7 +170,7 @@ FROM ubuntu:22.04 AS base
170170
WORKDIR "/"
171171
RUN apt-get update -qq
172172
RUN apt-get install -y --no-install-recommends wget
173-
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.20.1/setup_cpp_linux"
173+
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.21.0/setup_cpp_linux"
174174
RUN chmod +x ./setup_cpp_linux
175175

176176
# install llvm, cmake, ninja, and ccache
@@ -262,7 +262,7 @@ stages:
262262
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F
263263

264264
.setup_cpp: &setup_cpp |
265-
curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.20.1/setup_cpp_linux"
265+
curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.21.0/setup_cpp_linux"
266266
chmod +x setup_cpp_linux
267267
./setup_cpp_linux --compiler $compiler --cmake true --ninja true --ccache true --vcpkg true
268268
source ~/.cpprc
@@ -297,7 +297,7 @@ test_linux_gcc:
297297
## Usage Examples
298298

299299
- [cpp_vcpkg_project project](https://github.com/aminya/cpp_vcpkg_project)
300-
- [project_optins](https://github.com/aminya/project_options)
300+
- [project_options](https://github.com/aminya/project_options)
301301
- [cpp-best-practices starter project](https://github.com/cpp-best-practices/cpp_starter_project)
302302
- [ftxui](https://github.com/ArthurSonzogni/FTXUI)
303303
- [inja](https://github.com/pantor/inja)

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ inputs:
8080
required: false
8181

8282
runs:
83-
using: "node12"
84-
main: "dist/setup_cpp.js"
83+
using: "node16"
84+
main: "dist/node16/setup_cpp.js"
8585

8686
branding:
8787
icon: "award"

dev/docker/arch_node.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RUN pacman -S --noconfirm --needed nodejs
1111
RUN pacman -S --noconfirm --needed curl
1212

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

1717
# run installation

dev/docker/fedora_node.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN dnf -y install nodejs
88
RUN dnf -y install curl
99

1010
# add setup_cpp.js
11-
COPY "./dist/" "/"
11+
COPY "./dist/node12" "/"
1212
WORKDIR "/"
1313

1414
# run installation

dev/docker/ubuntu.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ FROM ubuntu:22.04 AS base
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.20.1/setup_cpp_linux"
8+
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.21.0/setup_cpp_linux"
99
RUN chmod +x ./setup_cpp_linux
1010

1111
# install llvm, cmake, ninja, and ccache

dev/docker/ubuntu_20.04_node.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
1212
RUN apt-get install -y --no-install-recommends nodejs
1313

1414
# add setup_cpp.js
15-
ADD "./dist/" "/"
15+
COPY "./dist/node12" "/"
1616
WORKDIR "/"
1717

1818
# run installation

dev/docker/ubuntu_node.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ RUN apt-get update -qq
44
RUN apt-get install -y --no-install-recommends nodejs
55

66
# add setup_cpp.js
7-
COPY "./dist/" "/"
7+
COPY "./dist/node12" "/"
88
WORKDIR "/"
99

1010
# run installation

dev/scripts/pack-exe.js renamed to dev/scripts/pack-exe.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { exec } = require("@actions/exec")
1+
import { node } from "execa"
22

33
function getPlatformName() {
44
switch (process.platform) {
@@ -26,13 +26,19 @@ function main() {
2626

2727
return Promise.all(
2828
exes.map((exe) =>
29-
exec(
30-
`./node_modules/.bin/caxa --input ./dist --output ./exe/setup_cpp_${getPlatformName()}${exe} -- "{{caxa}}/node_modules/.bin/node${exe}" "{{caxa}}/setup_cpp.js"`
31-
)
29+
node("./node_modules/caxa/build/index.mjs", [
30+
"--input",
31+
"./dist/node16",
32+
"--output",
33+
`./exe/setup_cpp_${getPlatformName()}${exe}`,
34+
"--",
35+
`{{caxa}}/node_modules/.bin/node${exe}`,
36+
`{{caxa}}/setup_cpp.js`,
37+
])
3238
)
3339
)
3440
}
3541

36-
main().then((exit) => {
37-
process.exit(exit)
42+
main().catch((err) => {
43+
throw err
3844
})

dev/scripts/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

0 commit comments

Comments
 (0)