mirror of https://github.com/aminya/setup-cpp
Merge pull request #164 from abeimler/fix/update-node [skip ci]
This commit is contained in:
commit
28d8edddbf
|
@ -1,4 +1,20 @@
|
|||
.parcel-cache/
|
||||
node_modules/
|
||||
dev/docker/
|
||||
dev/container-tests/
|
||||
.git/
|
||||
# OS metadata
|
||||
**/.DS_Store
|
||||
**/Thumbs.db
|
||||
|
||||
# Node
|
||||
**/node_modules
|
||||
**/package-lock.json
|
||||
**/temp-*
|
||||
|
||||
# TypeScript
|
||||
**/*.tsbuildinfo
|
||||
|
||||
# Build directories
|
||||
**/packages/*/dist/
|
||||
**/.parcel-cache
|
||||
**/exe/
|
||||
**/*.log
|
||||
**/*.exe
|
||||
**/.cache/
|
||||
|
|
|
@ -24,11 +24,9 @@ jobs:
|
|||
- macos-12
|
||||
- macos-11
|
||||
node:
|
||||
- 16
|
||||
- 20
|
||||
pnpm:
|
||||
- 7
|
||||
cache_reset_counter:
|
||||
- 0
|
||||
- 8
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -40,6 +38,7 @@ jobs:
|
|||
path: |
|
||||
~/.pnpm-store
|
||||
D:\.pnpm-store
|
||||
./node_modules
|
||||
key: "setupcpp-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
|
||||
restore-keys: |
|
||||
"setupcpp-cache-OS:${{ matrix.os }}-"
|
||||
|
@ -81,6 +80,22 @@ jobs:
|
|||
./dist
|
||||
retention-days: 1
|
||||
|
||||
- name: Setup Node 12
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 12
|
||||
- name: Smoke Test Node 12
|
||||
run: |
|
||||
node ./dist/legacy/setup-cpp.js --help
|
||||
|
||||
- name: Setup Node 16
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Smoke Test Node 16
|
||||
run: |
|
||||
node ./dist/node16/setup-cpp.js --help
|
||||
|
||||
Release:
|
||||
needs: Test
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
@ -104,10 +119,11 @@ jobs:
|
|||
./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/
|
||||
./dist/legacy/setup-cpp.js
|
||||
./dist/legacy/setup-cpp.js.map
|
||||
./dist/legacy/
|
||||
./dist/node16/
|
||||
./dist/node20/
|
||||
|
||||
Docker:
|
||||
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip test]') }}
|
||||
|
@ -116,18 +132,15 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-20.04
|
||||
container:
|
||||
- "ubuntu_node.dockerfile"
|
||||
- "ubuntu_20.04_node.dockerfile"
|
||||
- "arch_node.dockerfile"
|
||||
- "fedora_node.dockerfile"
|
||||
- ubuntu-22.04
|
||||
node:
|
||||
- 14
|
||||
- 20
|
||||
pnpm:
|
||||
- 6
|
||||
cache_reset_counter:
|
||||
- 0
|
||||
- 8
|
||||
container:
|
||||
- "./dev/docker/__tests__/arch.dockerfile"
|
||||
- "./dev/docker/__tests__/fedora.dockerfile"
|
||||
- "./dev/docker/__tests__/ubuntu.dockerfile"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -139,9 +152,11 @@ jobs:
|
|||
path: |
|
||||
~/.pnpm-store
|
||||
D:\.pnpm-store
|
||||
key: "setupcpp-docker-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}-${{ matrix.cache_reset_counter }}"
|
||||
./node_modules
|
||||
key: "setupcpp-docker-cache-OS:${{ matrix.os }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
|
||||
restore-keys: |
|
||||
"setupcpp-docker-cache-OS:${{ matrix.os }}"
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
|
@ -159,4 +174,4 @@ jobs:
|
|||
- name: Build
|
||||
id: docker_build
|
||||
run: |
|
||||
docker build -f ./dev/docker/${{ matrix.container }} -t setup-cpp .
|
||||
docker build -f ${{ matrix.container }} -t setup-cpp .
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
node_modules
|
||||
package.json
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
CHANGELOG.md
|
||||
|
|
26
README.md
26
README.md
|
@ -153,29 +153,29 @@ Here is an example for using setup-cpp to make a builder image that has the Cpp
|
|||
|
||||
```dockerfile
|
||||
#### Base Image
|
||||
FROM ubuntu:22.04 AS base
|
||||
FROM ubuntu:22.04 as base
|
||||
|
||||
# add setup-cpp
|
||||
RUN apt-get update -qq
|
||||
RUN apt-get install -y --no-install-recommends npm
|
||||
RUN npm install -g setup-cpp
|
||||
# install nodejs and setup-cpp
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install -y --no-install-recommends nodejs npm && \
|
||||
npm install -g setup-cpp
|
||||
|
||||
# install llvm, cmake, ninja, and ccache
|
||||
RUN setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --make true
|
||||
RUN setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --task true
|
||||
|
||||
CMD source ~/.cpprc
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
#### Building
|
||||
FROM base AS builder
|
||||
ADD ./dev/cpp_vcpkg_project /home/app
|
||||
#### Building (example)
|
||||
FROM base as builder
|
||||
COPY ./dev/cpp_vcpkg_project /home/app
|
||||
WORKDIR /home/app
|
||||
RUN bash -c 'source ~/.cpprc \
|
||||
&& make build'
|
||||
&& task build'
|
||||
|
||||
|
||||
### Running environment
|
||||
# use a distroless image or ubuntu:22.04 if you wish
|
||||
FROM gcr.io/distroless/cc
|
||||
FROM gcr.io/distroless/cc as runner
|
||||
# copy the built binaries and their runtime dependencies
|
||||
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
|
||||
WORKDIR /home/app/
|
||||
|
@ -217,7 +217,7 @@ jobs:
|
|||
- name: Build
|
||||
id: docker_build
|
||||
run: |
|
||||
docker build -f ./dev/docker/debian.dockerfile -t setup-cpp .
|
||||
docker build -f ./dev/docker/ubuntu.dockerfile -t setup-cpp .
|
||||
```
|
||||
|
||||
### Inside GitLab pipelines
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c30589196b2c59a3055dfc7c24244b4a1f48b081
|
||||
Subproject commit b10f2e841835b93cee67dff1eb70d6fa5c0ac0cd
|
|
@ -0,0 +1,30 @@
|
|||
## base image
|
||||
FROM archlinux as base
|
||||
|
||||
# install nodejs
|
||||
RUN pacman -Syuu --noconfirm && \
|
||||
pacman-db-upgrade && \
|
||||
pacman -S --noconfirm --needed nodejs
|
||||
|
||||
# add setup-cpp.js (built outside of this dockerfile)
|
||||
COPY "./dist/legacy" "/"
|
||||
|
||||
# run installation
|
||||
RUN node /setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
#### Building (example)
|
||||
FROM base AS example-builder
|
||||
COPY ./dev/cpp_vcpkg_project /home/app
|
||||
WORKDIR /home/app
|
||||
RUN bash -c 'source ~/.cpprc \
|
||||
&& task build'
|
||||
|
||||
#### Running environment
|
||||
# use a distroless image or ubuntu:22.04 if you wish
|
||||
FROM gcr.io/distroless/cc as runner
|
||||
# copy the built binaries and their runtime dependencies
|
||||
COPY --from=example-builder /home/app/build/my_exe/Release/ /home/app/
|
||||
WORKDIR /home/app/
|
||||
ENTRYPOINT ["./my_exe"]
|
|
@ -0,0 +1,29 @@
|
|||
## base image
|
||||
FROM fedora as base
|
||||
|
||||
# install nodejs and setup-cpp
|
||||
RUN dnf -y install nodejs npm && \
|
||||
npm install -g setup-cpp
|
||||
|
||||
# add setup-cpp.js (built outside of this dockerfile)
|
||||
COPY "./dist/legacy" "/"
|
||||
|
||||
# run installation
|
||||
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
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
#### Building (example)
|
||||
FROM base AS example-builder
|
||||
COPY ./dev/cpp_vcpkg_project /home/app
|
||||
WORKDIR /home/app
|
||||
RUN bash -c 'source ~/.cpprc \
|
||||
&& task build'
|
||||
|
||||
#### Running environment
|
||||
# use a distroless image or ubuntu:22.04 if you wish
|
||||
FROM gcr.io/distroless/cc as runner
|
||||
# copy the built binaries and their runtime dependencies
|
||||
COPY --from=example-builder /home/app/build/my_exe/Release/ /home/app/
|
||||
WORKDIR /home/app/
|
||||
ENTRYPOINT ["./my_exe"]
|
|
@ -1,20 +1,18 @@
|
|||
## base image
|
||||
FROM fedora as base
|
||||
#### Base Image
|
||||
FROM ubuntu:22.04 as base
|
||||
|
||||
# nodejs and curl for downloading setup-cpp
|
||||
RUN dnf -y install nodejs curl
|
||||
# install nodejs and setup-cpp
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install -y --no-install-recommends nodejs
|
||||
|
||||
# add setup-cpp.js
|
||||
COPY "./dist/node12" "/"
|
||||
WORKDIR "/"
|
||||
# add setup-cpp.js (built outside of this dockerfile)
|
||||
COPY "./dist/legacy" "/"
|
||||
|
||||
# run installation
|
||||
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
|
||||
# install setup-cpp
|
||||
RUN node /setup-cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --task true
|
||||
|
||||
CMD ["source", "~/.cpprc"]
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
|
||||
#### Building
|
||||
FROM base as builder
|
||||
COPY ./dev/cpp_vcpkg_project /home/app
|
|
@ -0,0 +1,28 @@
|
|||
## base image
|
||||
FROM archlinux as base
|
||||
|
||||
# install nodejs and setup-cpp
|
||||
RUN pacman -Syuu --noconfirm && \
|
||||
pacman-db-upgrade && \
|
||||
pacman -S --noconfirm --needed nodejs npm && \
|
||||
npm install -g setup-cpp
|
||||
|
||||
# run installation
|
||||
RUN setup-cpp --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
#### Building (example)
|
||||
FROM base AS example-builder
|
||||
COPY ./dev/cpp_vcpkg_project /home/app
|
||||
WORKDIR /home/app
|
||||
RUN bash -c 'source ~/.cpprc \
|
||||
&& task build'
|
||||
|
||||
#### Running environment
|
||||
# use a distroless image or ubuntu:22.04 if you wish
|
||||
FROM gcr.io/distroless/cc as runner
|
||||
# copy the built binaries and their runtime dependencies
|
||||
COPY --from=example-builder /home/app/build/my_exe/Release/ /home/app/
|
||||
WORKDIR /home/app/
|
||||
ENTRYPOINT ["./my_exe"]
|
|
@ -1,38 +0,0 @@
|
|||
## base image
|
||||
FROM archlinux as base
|
||||
|
||||
RUN pacman -Syuu --noconfirm
|
||||
RUN pacman-db-upgrade
|
||||
|
||||
# nodejs
|
||||
RUN pacman -S --noconfirm --needed nodejs
|
||||
|
||||
# curl for downloading setup-cpp
|
||||
RUN pacman -S --noconfirm --needed curl
|
||||
|
||||
# add setup-cpp.js
|
||||
COPY "./dist/node12" "/"
|
||||
WORKDIR "/"
|
||||
|
||||
# run installation
|
||||
RUN node ./setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
|
||||
|
||||
CMD ["source", "~/.cpprc"]
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
|
||||
#### Building
|
||||
FROM base as builder
|
||||
COPY ./dev/cpp_vcpkg_project /home/app
|
||||
WORKDIR /home/app
|
||||
RUN bash -c 'source ~/.cpprc \
|
||||
&& task build'
|
||||
|
||||
|
||||
### Running environment
|
||||
# use a distroless image or ubuntu:22.04 if you wish
|
||||
FROM gcr.io/distroless/cc as runner
|
||||
# copy the built binaries and their runtime dependencies
|
||||
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
|
||||
WORKDIR /home/app/
|
||||
ENTRYPOINT ["./my_exe"]
|
|
@ -0,0 +1,26 @@
|
|||
## base image
|
||||
FROM fedora as base
|
||||
|
||||
# install nodejs and setup-cpp
|
||||
RUN dnf -y install nodejs npm && \
|
||||
npm install -g setup-cpp
|
||||
|
||||
# run installation
|
||||
RUN setup-cpp --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
#### Building (example)
|
||||
FROM base AS example-builder
|
||||
COPY ./dev/cpp_vcpkg_project /home/app
|
||||
WORKDIR /home/app
|
||||
RUN bash -c 'source ~/.cpprc \
|
||||
&& task build'
|
||||
|
||||
#### Running environment
|
||||
# use a distroless image or ubuntu:22.04 if you wish
|
||||
FROM gcr.io/distroless/cc as runner
|
||||
# copy the built binaries and their runtime dependencies
|
||||
COPY --from=example-builder /home/app/build/my_exe/Release/ /home/app/
|
||||
WORKDIR /home/app/
|
||||
ENTRYPOINT ["./my_exe"]
|
|
@ -1,19 +1,17 @@
|
|||
#### Base Image
|
||||
FROM ubuntu:22.04 as base
|
||||
|
||||
# install setup-cpp
|
||||
RUN apt-get update -qq
|
||||
RUN apt-get install -y --no-install-recommends npm
|
||||
RUN npm install -g setup-cpp
|
||||
# install nodejs and setup-cpp
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install -y --no-install-recommends nodejs npm && \
|
||||
npm install -g setup-cpp
|
||||
|
||||
# install llvm, cmake, ninja, and ccache
|
||||
RUN setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --task true
|
||||
|
||||
CMD ["source", "~/.cpprc"]
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
|
||||
#### Building
|
||||
#### Building (example)
|
||||
FROM base as builder
|
||||
COPY ./dev/cpp_vcpkg_project /home/app
|
||||
WORKDIR /home/app
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
FROM ubuntu:20.04 as base
|
||||
|
||||
# set time-zone
|
||||
ENV TZ=Canada/Pacific
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
# The nodejs that ships on ubuntu:20.04 servers is too old.
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update -qq
|
||||
RUN apt-get install -y --no-install-recommends curl gnupg ca-certificates
|
||||
RUN ["/bin/bash", "-c", "set -o pipefail && curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -"]
|
||||
RUN apt-get install -y --no-install-recommends nodejs
|
||||
|
||||
# add setup-cpp.js
|
||||
COPY "./dist/node12" "/"
|
||||
WORKDIR "/"
|
||||
|
||||
# run installation
|
||||
RUN node ./setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
|
||||
|
||||
CMD ["source", "~/.cpprc"]
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
|
||||
#### Building
|
||||
FROM base as builder
|
||||
COPY ./dev/cpp_vcpkg_project /home/app
|
||||
WORKDIR /home/app
|
||||
RUN bash -c 'source ~/.cpprc \
|
||||
&& task build'
|
||||
|
||||
|
||||
### Running environment
|
||||
# use a distroless image or ubuntu:20.04 if you wish
|
||||
FROM gcr.io/distroless/cc as runner
|
||||
# copy the built binaries and their runtime dependencies
|
||||
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
|
||||
WORKDIR /home/app/
|
||||
ENTRYPOINT ["./my_exe"]
|
|
@ -1,31 +0,0 @@
|
|||
FROM ubuntu:22.04 AS base
|
||||
|
||||
RUN apt-get update -qq
|
||||
RUN apt-get install -y --no-install-recommends nodejs
|
||||
|
||||
# add setup-cpp.js
|
||||
COPY "./dist/node12" "/"
|
||||
WORKDIR "/"
|
||||
|
||||
# run installation
|
||||
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
|
||||
|
||||
CMD ["source", "~/.cpprc"]
|
||||
ENTRYPOINT [ "/bin/bash" ]
|
||||
|
||||
|
||||
#### Building
|
||||
FROM base AS builder
|
||||
COPY ./dev/cpp_vcpkg_project /home/app
|
||||
WORKDIR /home/app
|
||||
RUN bash -c 'source ~/.cpprc \
|
||||
&& task build'
|
||||
|
||||
|
||||
### Running environment
|
||||
# use a distroless image or ubuntu:22.04 if you wish
|
||||
FROM gcr.io/distroless/cc as runner
|
||||
# copy the built binaries and their runtime dependencies
|
||||
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
|
||||
WORKDIR /home/app/
|
||||
ENTRYPOINT ["./my_exe"]
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "gcc",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "llvm",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "msvc",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(?:\\s+\\d+>)?(\\S.*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"code": 5,
|
||||
"message": 6
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "python",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$",
|
||||
"file": 1,
|
||||
"line": 2
|
||||
},
|
||||
{
|
||||
"regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$",
|
||||
"message": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
57
package.json
57
package.json
|
@ -5,14 +5,12 @@
|
|||
"repository": "https://github.com/aminya/setup-cpp",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Amin Yahyaabadi",
|
||||
"exports": {
|
||||
"import": "./dist/node12/setup-cpp.mjs",
|
||||
"require": "./dist/node12/setup-cpp.js"
|
||||
},
|
||||
"main": "dist/node12/setup-cpp.js",
|
||||
"main": "dist/legacy/setup-cpp.js",
|
||||
"actions": "./dist/actions/setup-cpp.js",
|
||||
"modern": "./dist/modern/setup-cpp.js",
|
||||
"source": "./src/main.ts",
|
||||
"bin": {
|
||||
"setup-cpp": "dist/node12/setup-cpp.js"
|
||||
"setup-cpp": "dist/legacy/setup-cpp.js"
|
||||
},
|
||||
"files": [
|
||||
"action.yml",
|
||||
|
@ -30,7 +28,7 @@
|
|||
"tsconfig.json"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "shx rm -rf dist/ && shx mkdir -p ./dist/node12 ./dist/node16 && run-p lint.tsc build.parcel copy.matchers",
|
||||
"build": "shx rm -rf dist/ && shx mkdir -p ./dist/legacy ./dist/actions ./dist/modern && run-p lint.tsc build.parcel copy.matchers",
|
||||
"build.docker": "pnpm build && docker build -f ./dev/docker/ubuntu_node.dockerfile -t setup-cpp .",
|
||||
"build.docker.arch": "pnpm build && docker build -f ./dev/docker/arch_node.dockerfile -t setup-cpp:arch .",
|
||||
"build.docker.fedora": "pnpm build && docker build -f ./dev/docker/fedora_node.dockerfile -t setup-cpp:fedora .",
|
||||
|
@ -38,7 +36,10 @@
|
|||
"build.parcel": "cross-env NODE_ENV=production parcel build && babel ./dist --out-dir dist --plugins @upleveled/babel-plugin-remove-node-prefix --compact --no-babelrc --source-maps true",
|
||||
"bump": "ncu -u -x numerous && pnpm update",
|
||||
"clean": "shx rm -rf .parcel-cache dist exe",
|
||||
"copy.matchers": "shx cp ./src/gcc/gcc_matcher.json ./dist/node12/ && shx cp ./src/msvc/msvc_matcher.json ./dist/node12/ && shx cp ./src/python/python_matcher.json ./dist/node12/ && shx cp ./src/llvm/llvm_matcher.json ./dist/node12/ && shx cp ./dist/node12/*.json ./dist/node16/",
|
||||
"copy.matchers": "run-p copy.matchers.legacy copy.matchers.actions copy.matchers.modern",
|
||||
"copy.matchers.legacy": "shx cp ./src/gcc/gcc_matcher.json ./dist/legacy/ && shx cp ./src/msvc/msvc_matcher.json ./dist/legacy/ && shx cp ./src/python/python_matcher.json ./dist/legacy/ && shx cp ./src/llvm/llvm_matcher.json ./dist/legacy/",
|
||||
"copy.matchers.actions": "shx cp ./src/gcc/gcc_matcher.json ./dist/actions/ && shx cp ./src/msvc/msvc_matcher.json ./dist/actions/ && shx cp ./src/python/python_matcher.json ./dist/actions/ && shx cp ./src/llvm/llvm_matcher.json ./dist/actions/",
|
||||
"copy.matchers.modern": "shx cp ./src/gcc/gcc_matcher.json ./dist/modern/ && shx cp ./src/msvc/msvc_matcher.json ./dist/modern/ && shx cp ./src/python/python_matcher.json ./dist/modern/ && shx cp ./src/llvm/llvm_matcher.json ./dist/modern/",
|
||||
"dev": "cross-env NODE_ENV=development parcel watch",
|
||||
"docs": "shx rm -rf packages/*/README.md && pnpm -r exec readme --path ../../dev/readme/template.md -y && pnpm -r exec ts-readme",
|
||||
"format": "run-s lint.prettier",
|
||||
|
@ -54,9 +55,9 @@
|
|||
"start.docker.fedora": "docker run -t setup-cpp:fedora .",
|
||||
"start.docker.ubuntu": "docker run -t setup-cpp:ubuntu .",
|
||||
"test": "run-p --continue-on-error test.lint test.unit",
|
||||
"test.docker.arch": "docker build -f ./dev/docker/arch_node.dockerfile --target base -t setup-cpp:arch-base . && container-structure-test test --image setup-cpp:arch-base --config ./dev/container-tests/arch.yml",
|
||||
"test.docker.fedora": "docker build -f ./dev/docker/fedora_node.dockerfile --target base -t setup-cpp:fedora-base . && container-structure-test test --image setup-cpp:fedora-base --config ./dev/container-tests/fedora.yml",
|
||||
"test.docker.ubuntu": "docker build -f ./dev/docker/ubuntu_node.dockerfile --target base -t setup-cpp:ubuntu-base . && container-structure-test test --image setup-cpp:ubuntu-base --config ./dev/container-tests/ubuntu.yml",
|
||||
"test.docker.arch": "docker build -f ./dev/docker/arch_node.dockerfile --target setup-cpp -t setup-cpp:arch-base . && container-structure-test test --image setup-cpp:arch-base --config ./dev/container-tests/arch.yml",
|
||||
"test.docker.fedora": "docker build -f ./dev/docker/fedora_node.dockerfile --target setup-cpp -t setup-cpp:fedora-base . && container-structure-test test --image setup-cpp:fedora-base --config ./dev/container-tests/fedora.yml",
|
||||
"test.docker.ubuntu": "docker build -f ./dev/docker/ubuntu_node.dockerfile --target setup-cpp -t setup-cpp:ubuntu-base . && container-structure-test test --image setup-cpp:ubuntu-base --config ./dev/container-tests/ubuntu.yml",
|
||||
"test.lint": "run-p --aggregate-output --continue-on-error lint.cspell test.lint.eslint test.lint.prettier lint.tsc",
|
||||
"test.lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
|
||||
"test.lint.prettier": "prettier . --check",
|
||||
|
@ -68,12 +69,12 @@
|
|||
"@actions/exec": "^1.1.1",
|
||||
"@actions/io": "^1.1.3",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@babel/cli": "^7.22.5",
|
||||
"@babel/cli": "^7.22.9",
|
||||
"@types/cross-spawn": "^6.0.2",
|
||||
"@types/eslint": "^8.40.2",
|
||||
"@types/jest": "^29.5.2",
|
||||
"@types/eslint": "^8.44.0",
|
||||
"@types/jest": "^29.5.3",
|
||||
"@types/mri": "^1.1.1",
|
||||
"@types/node": "^20.3.2",
|
||||
"@types/node": "^20.4.2",
|
||||
"@types/npmcli__ci-detect": "^2.0.0",
|
||||
"@types/prettier": "2.7.3",
|
||||
"@types/semver": "^7.5.0",
|
||||
|
@ -89,20 +90,20 @@
|
|||
"escape-path-with-spaces": "^1.0.2",
|
||||
"escape-quotes": "^1.0.2",
|
||||
"escape-string-regexp": "^5.0.0",
|
||||
"eslint": "^8.43.0",
|
||||
"eslint": "^8.45.0",
|
||||
"eslint-config-atomic": "^1.19.3",
|
||||
"exec-powershell": "workspace:*",
|
||||
"execa": "^7.1.1",
|
||||
"fast-glob": "^3.2.12",
|
||||
"fast-glob": "^3.3.0",
|
||||
"find-up": "^6.3.0",
|
||||
"gen-readme": "^1.6.0",
|
||||
"is-url-online": "^1.5.0",
|
||||
"jest": "^29.5.0",
|
||||
"jest": "^29.6.1",
|
||||
"micro-memoize": "^4.1.2",
|
||||
"mri": "^1.2.0",
|
||||
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#9f672c1",
|
||||
"npm-check-updates": "^16.10.13",
|
||||
"npm-run-all2": "^6.0.5",
|
||||
"npm-check-updates": "^16.10.15",
|
||||
"npm-run-all2": "^6.0.6",
|
||||
"numerous": "1.0.3",
|
||||
"parcel": "2.9.3",
|
||||
"path-exists": "^5.0.0",
|
||||
|
@ -117,10 +118,10 @@
|
|||
"shx": "0.3.4",
|
||||
"simple-update-notifier": "^2.0.0",
|
||||
"time-delta": "github:aminya/time-delta#69d91a41cef28e569be9a2991129f5f7d1f0d00e",
|
||||
"ts-jest": "^29.1.0",
|
||||
"ts-jest": "^29.1.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"ts-readme": "^1.1.3",
|
||||
"typescript": "^5.1.5",
|
||||
"typescript": "^5.1.6",
|
||||
"ubuntu-version": "^2.0.0",
|
||||
"untildify-user": "workspace:*",
|
||||
"user-access": "workspace:*",
|
||||
|
@ -152,7 +153,6 @@
|
|||
"electron": false,
|
||||
"patha": "patha/dist/index.node.mjs"
|
||||
},
|
||||
"main.actions": "./dist/node16/setup-cpp.js",
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"whatwg-url": "^12"
|
||||
|
@ -170,7 +170,7 @@
|
|||
"optimize": true,
|
||||
"outputFormat": "commonjs"
|
||||
},
|
||||
"main.actions": {
|
||||
"actions": {
|
||||
"context": "node",
|
||||
"engines": {
|
||||
"node": ">=16.x"
|
||||
|
@ -180,6 +180,15 @@
|
|||
},
|
||||
"optimize": true,
|
||||
"outputFormat": "commonjs"
|
||||
},
|
||||
"modern": {
|
||||
"context": "node",
|
||||
"engines": {
|
||||
"node": ">=20.x"
|
||||
},
|
||||
"includeNodeModules": true,
|
||||
"optimize": true,
|
||||
"outputFormat": "commonjs"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"build": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.9.1",
|
||||
"@actions/core": "^1.10.0",
|
||||
"ci-info": "^3.8.0"
|
||||
},
|
||||
"keywords": [
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"which": "^2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/which": "^2.0.1"
|
||||
"@types/which": "^2.0.2"
|
||||
},
|
||||
"keywords": [
|
||||
"powershell",
|
||||
|
|
1775
pnpm-lock.yaml
1775
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -93,7 +93,7 @@ export async function getBinVersion(file: string, versionRegex: RegExp = default
|
|||
const execout = await getExecOutput(file, ["--version"])
|
||||
const version_output = execout.stdout || execout.stderr || ""
|
||||
const version = version_output.trim().match(versionRegex)?.[1]
|
||||
return semverCoerce(version) ?? undefined
|
||||
return version
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return undefined
|
||||
|
@ -107,7 +107,12 @@ export async function isBinUptoDate(
|
|||
versionRegex: RegExp = defaultVersionRegex
|
||||
) {
|
||||
const givenVersion = await getBinVersion(givenFile, versionRegex)
|
||||
if (givenVersion !== undefined && targetVersion !== "") {
|
||||
if (
|
||||
typeof givenVersion === "string" &&
|
||||
typeof targetVersion === "string" &&
|
||||
givenVersion !== "" &&
|
||||
targetVersion !== ""
|
||||
) {
|
||||
return semverCompare(givenVersion, targetVersion) !== -1
|
||||
} else {
|
||||
// assume given version is old
|
||||
|
|
|
@ -31,7 +31,7 @@ export const DefaultVersions: Record<string, string | undefined> = {
|
|||
}
|
||||
|
||||
export const MinVersions: Record<string, string | undefined> = {
|
||||
pip: "22.2.0",
|
||||
pip: "22.3.1",
|
||||
python: "3.7.9",
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue