Skip to content

Commit ba98fd0

Browse files
committed
ci: moved homebrew instructions to its own script/brew-install.sh
1 parent daad150 commit ba98fd0

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

.gitlab-ci.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cache:
4040
- ./tmp/chocolatey/
4141
# `jest` cache is configured in jest.config.js
4242
- ./tmp/jest/
43-
# `node-gyp` cache used by windows and macos
43+
# `npm_config_devdir` cache for `node-gyp` headers and libraries used by windows and macos
4444
- ./tmp/node-gyp
4545

4646
stages:
@@ -166,7 +166,7 @@ build:windows:
166166
before_script:
167167
- mkdir -Force "$CI_PROJECT_DIR/tmp"
168168
script:
169-
- .\scripts\choco-install.ps1
169+
- ./scripts/choco-install.ps1
170170
- refreshenv
171171
- npm install --ignore-scripts
172172
- $env:Path = "$(npm bin);" + $env:Path
@@ -192,22 +192,14 @@ build:macos:
192192
- shared-macos-amd64
193193
image: macos-11-xcode-12
194194
variables:
195-
HOMEBREW_NO_INSTALL_UPGRADE: "true"
196-
HOMEBREW_NO_INSTALL_CLEANUP: "true"
197-
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "true"
198-
HOMEBREW_NO_AUTO_UPDATE: "true"
199195
# Location node-gyp installed headers and static libraries
200196
npm_config_devdir: "${CI_PROJECT_DIR}/tmp/node-gyp"
201197
# Produce universal binary
202198
npm_config_arch: 'x64+arm64'
203-
before_script:
199+
script:
204200
- eval "$(brew shellenv)"
205-
- brew install node@16
206-
- brew link --overwrite node@16
207-
- brew install [email protected]
208-
- brew link --overwrite [email protected]
201+
- ./scripts/brew-install.sh
209202
- hash -r
210-
script:
211203
- npm install --ignore-scripts
212204
- export PATH="$(npm bin):$PATH"
213205
- npm run build --verbose

scripts/brew-install.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit # abort on nonzero exitstatus
4+
set -o nounset # abort on unbound variable
5+
set -o pipefail # don't hide errors within pipes
6+
7+
export HOMEBREW_NO_INSTALL_UPGRADE='true'
8+
export HOMEBREW_NO_INSTALL_CLEANUP='true'
9+
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK='true'
10+
export HOMEBREW_NO_AUTO_UPDATE='true'
11+
12+
brew install node@16
13+
brew link --overwrite node@16
14+
brew install [email protected]
15+
brew link --overwrite [email protected]

0 commit comments

Comments
 (0)