2020-01-13 22:11:56 -05:00
|
|
|
version: 2.1
|
|
|
|
workflows:
|
2020-03-31 19:52:36 -04:00
|
|
|
macos:
|
|
|
|
jobs:
|
|
|
|
- build_for_macos:
|
2020-04-03 17:06:28 -04:00
|
|
|
context: code-sign-macOS
|
2020-01-13 22:11:56 -05:00
|
|
|
windows:
|
|
|
|
jobs:
|
|
|
|
- build_for_windows:
|
|
|
|
context: code-sign-generic
|
|
|
|
orbs:
|
|
|
|
windows: circleci/windows@2.2.0
|
2020-03-31 19:52:36 -04:00
|
|
|
jobs:
|
|
|
|
build_for_macos:
|
|
|
|
macos:
|
|
|
|
xcode: 11.1.0 # last version for which CircleCI uses macOS 10.14.x
|
|
|
|
steps:
|
|
|
|
- checkout
|
2020-04-03 17:38:06 -04:00
|
|
|
- shared_build_steps:
|
|
|
|
npmCacheDir: "/Users/distiller/.npm"
|
2020-03-31 19:52:36 -04:00
|
|
|
- run:
|
|
|
|
name: Move macOS build products to artifacts directory
|
|
|
|
command: |
|
|
|
|
mkdir -p Artifacts/
|
|
|
|
mv dist/{Scratch*.dmg,mas/Scratch*.pkg} Artifacts/
|
|
|
|
- store_artifacts:
|
|
|
|
path: Artifacts/
|
|
|
|
build_for_windows:
|
|
|
|
executor:
|
|
|
|
name: 'windows/default'
|
|
|
|
shell: "bash.exe"
|
|
|
|
steps:
|
|
|
|
- checkout
|
2020-04-03 17:38:06 -04:00
|
|
|
- shared_build_steps:
|
|
|
|
npmCacheDir: "C:/Users/circleci/AppData/Roaming/npm-cache"
|
2020-01-13 22:11:56 -05:00
|
|
|
- run:
|
2020-03-31 19:52:36 -04:00
|
|
|
name: Move Windows build products to artifacts directory
|
2020-01-13 22:11:56 -05:00
|
|
|
command: |
|
|
|
|
mkdir -p Artifacts/
|
|
|
|
mv dist/{Scratch*.appx,Scratch*.exe} Artifacts/
|
|
|
|
- store_artifacts:
|
|
|
|
path: Artifacts/
|
2020-04-03 17:06:28 -04:00
|
|
|
commands:
|
|
|
|
shared_build_steps:
|
|
|
|
description: The build steps which are the same on all platforms. Does not include 'checkout'
|
2020-04-03 17:38:06 -04:00
|
|
|
parameters:
|
|
|
|
npmCacheDir:
|
|
|
|
type: string
|
|
|
|
description: NPM cache directory (`npm config cache get`) - usually either ~/.npm or %AppData%/npm-cache
|
2020-04-03 17:06:28 -04:00
|
|
|
steps:
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- npm-cache-{{ arch }}-{{ checksum "package-lock.json" }}
|
|
|
|
- run:
|
2020-04-03 17:38:06 -04:00
|
|
|
name: Install node_modules
|
|
|
|
# --prefer-offline "will make npm skip any conditional requests (304 checks) for stale cache data, and only
|
|
|
|
# hit the network if something is missing from the cache"
|
|
|
|
command: npm ci --prefer-offline
|
2020-04-03 17:06:28 -04:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
2020-04-03 17:38:06 -04:00
|
|
|
- << parameters.npmCacheDir >>
|
2020-04-03 17:06:28 -04:00
|
|
|
key: npm-cache-{{ arch }}-{{ checksum "package-lock.json" }}
|
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: npm run dist
|