Skip to content

Commit 3d4b9f3

Browse files
committed
fix node 0.8
1 parent e0c187d commit 3d4b9f3

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,20 +160,36 @@ jobs:
160160
persist-credentials: false
161161

162162
- name: Setup Node.js ${{ matrix.node-version }}
163+
if: ${{ matrix.node-version != '0.8' }}
163164
uses: actions/setup-node@v4
164165
with:
165166
node-version: ${{ matrix.node-version }}
166167

168+
- name: Setup Node.js 0.8
169+
if: ${{ matrix.node-version == '0.8' }} && matrix.os == 'ubuntu-20.04'
170+
shell: bash -eo pipefail -l {0}
171+
run: |
172+
nvm install --default ${{ matrix.node-version }}
173+
nvm install --alias=npm 0.10
174+
nvm use ${{ matrix.node-version }}
175+
if [[ "$(npm -v)" == 1.1.* ]]; then
176+
nvm exec npm npm install -g npm@1.1
177+
ln -fs "$(which npm)" "$(dirname "$(nvm which npm)")/npm"
178+
else
179+
sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")"
180+
fi
181+
npm config set strict-ssl false
182+
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
183+
167184
- name: Npm version fixes
168185
if: ${{matrix.npm-version != ''}}
169-
run: npm install -g ${{ matrix.npm-version }}
186+
shell: bash -eo pipefail -l {0}
187+
run: |
188+
npm install -g ${{ matrix.npm-version }}
170189
171190
- name: Configure npm
172191
shell: bash -eo pipefail -l {0}
173192
run: |
174-
if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
175-
npm config set strict-ssl false
176-
fi
177193
npm config set package-lock false
178194
179195
- name: Remove npm module(s) ${{ matrix.npm-rm }}

0 commit comments

Comments
 (0)