Skip to content

Commit e501201

Browse files
committed
build: update CI for npm TLS upgrade
1 parent 9f1fee2 commit e501201

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

.github/workflows/ci.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,14 @@ jobs:
6565
shell: bash -eo pipefail -l {0}
6666
run: |
6767
nvm install --default ${{ matrix.node-version }}
68-
if [[ "${{ matrix.node-version }}" == 0.* ]]; then npm config set strict-ssl false; fi
69-
if [[ "${{ matrix.node-version }}" == 0.8 ]]; then npm install -g [email protected]; fi
68+
if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
69+
nvm install --alias=npm 0.10
70+
npm install -g [email protected]
71+
NPM=$(which npm)
72+
nvm use ${{ matrix.node-version }}
73+
ln -fs "$NPM" "$(which npm)"
74+
sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")"
75+
fi
7076
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
7177
7278
- name: Configure npm

appveyor.yml

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
environment:
22
matrix:
3-
- nodejs_version: "0.8"
43
- nodejs_version: "0.10"
54
- nodejs_version: "4.9"
65
- nodejs_version: "6.17"
@@ -16,23 +15,18 @@ install:
1615
catch { Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) }
1716
# Setup npm
1817
- for /f "tokens=*" %%g in ('where npm') do (set npm_prefix=%%~dpg)
19-
- if "%nodejs_version%" equ "0.8" npm config set strict-ssl false
20-
- if "%nodejs_version%" equ "0.8" npm install -g --prefix "%npm_prefix:~0,-1%" [email protected]
2118
- npm config set shrinkwrap false
2219
# Remove all non-test dependencies
2320
- npm rm --silent --save-dev eslint eslint-plugin-markdown nyc
2421
# Setup Node.js version-specific dependencies
2522
- ps: |
2623
# mocha for testing
27-
# - use 2.x for Node.js < 0.10
2824
# - use 3.x for Node.js < 4
2925
# - use 5.x for Node.js < 6
3026
# - use 6.x for Node.js < 8
3127
# - use 7.x for Node.js < 10
3228
# - use 8.x for Node.js < 12
33-
if ([int]$env:nodejs_version.split(".")[0] -eq 0 -and [int]$env:nodejs_version.split(".")[1] -lt 10) {
34-
npm install --silent --save-dev [email protected]
35-
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 4) {
29+
if ([int]$env:nodejs_version.split(".")[0] -lt 4) {
3630
npm install --silent --save-dev [email protected]
3731
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 6) {
3832
npm install --silent --save-dev [email protected]
@@ -45,12 +39,9 @@ install:
4539
}
4640
- ps: |
4741
# supertest for http calls
48-
# - use 1.1.0 for Node.js < 0.10
4942
# - use 2.0.0 for Node.js < 4
5043
# - use 3.4.2 for Node.js < 6
51-
if ([int]$env:nodejs_version.split(".")[0] -eq 0 -and [int]$env:nodejs_version.split(".")[1] -lt 10) {
52-
npm install --silent --save-dev [email protected]
53-
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 4) {
44+
if ([int]$env:nodejs_version.split(".")[0] -lt 4) {
5445
npm install --silent --save-dev [email protected]
5546
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 6) {
5647
npm install --silent --save-dev [email protected]

0 commit comments

Comments
 (0)