put scratch-gui install into scratch-desktop postinstall

This commit is contained in:
Christopher Willis-Ford 2020-04-03 14:06:28 -07:00
parent 2cfca4c0ff
commit 245a3ec0d7
3 changed files with 25 additions and 28 deletions

View file

@ -3,33 +3,13 @@ workflows:
macos: macos:
jobs: jobs:
- build_for_macos: - build_for_macos:
context: code-sign-generic context: code-sign-macOS
windows: windows:
jobs: jobs:
- build_for_windows: - build_for_windows:
context: code-sign-generic context: code-sign-generic
orbs: orbs:
windows: circleci/windows@2.2.0 windows: circleci/windows@2.2.0
commands:
shared_build_steps:
description: "The build steps which are the same on all platforms. Does not include 'checkout'"
steps:
- restore_cache:
keys:
- npm-cache-{{ arch }}-{{ checksum "package-lock.json" }}
- run:
name: Install scratch-desktop dependencies
command: npm ci
- save_cache: # save cache BEFORE doing anything special with scratch-gui
paths:
- node_modules/
key: npm-cache-{{ arch }}-{{ checksum "package-lock.json" }}
- run:
name: Install scratch-gui dependencies
command: cd node_modules/scratch-gui && npm install
- run:
name: Build
command: npm run dist
jobs: jobs:
build_for_macos: build_for_macos:
macos: macos:
@ -58,3 +38,23 @@ jobs:
mv dist/{Scratch*.appx,Scratch*.exe} Artifacts/ mv dist/{Scratch*.appx,Scratch*.exe} Artifacts/
- store_artifacts: - store_artifacts:
path: Artifacts/ path: Artifacts/
commands:
shared_build_steps:
description: The build steps which are the same on all platforms. Does not include 'checkout'
steps:
- restore_cache:
keys:
- npm-cache-{{ arch }}-{{ checksum "package-lock.json" }}
- run:
name: Print NPM cache root
command: npm config get cache
- run:
name: Install scratch-desktop dependencies
command: npm ci
- save_cache:
paths:
- node_modules/
key: npm-cache-{{ arch }}-{{ checksum "package-lock.json" }}
- run:
name: Build
command: npm run dist

View file

@ -6,12 +6,11 @@
"version": "3.12.0", "version": "3.12.0",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"scripts": { "scripts": {
"postinstall": "node ./scripts/npm-in-gui.js install",
"start": "electron-webpack dev --bail --display-error-details --env.minify=false", "start": "electron-webpack dev --bail --display-error-details --env.minify=false",
"build-gui": "node ./scripts/run-in-gui.js build", "build-gui": "node ./scripts/npm-in-gui.js run build",
"watch-gui": "node ./scripts/run-in-gui.js watch", "watch-gui": "node ./scripts/npm-in-gui.js run watch",
"delete-gui": "rimraf ./node_modules/scratch-gui", "clean": "rimraf ./dist ./static/assets ./node_modules/scratch-gui/build ./node_modules/scratch-gui/dist",
"install-gui": "cd ./node_modules/scratch-gui && npm i",
"clean": "rimraf ./dist/ ./static/assets/",
"compile": "rimraf ./dist/ && electron-webpack --bail --display-error-details --env.minify=false", "compile": "rimraf ./dist/ && electron-webpack --bail --display-error-details --env.minify=false",
"fetch": "rimraf ./static/assets/ && mkdirp ./static/assets/ && node ./scripts/fetchMediaLibraryAssets.js", "fetch": "rimraf ./static/assets/ && mkdirp ./static/assets/ && node ./scripts/fetchMediaLibraryAssets.js",
"dist": "npm run build-gui && npm run fetch && npm run compile -p && node ./scripts/electron-builder-wrapper.js", "dist": "npm run build-gui && npm run fetch && npm run compile -p && node ./scripts/electron-builder-wrapper.js",

View file

@ -3,8 +3,6 @@ const path = require('path');
// process.argv: ['node', 'run-in-gui.js', 'foo', ...] // process.argv: ['node', 'run-in-gui.js', 'foo', ...]
const args = process.argv.slice(2); const args = process.argv.slice(2);
args.unshift('run');
// args: ['run', 'foo', ...]
// copy environment (including PATH) then add or replace BUILD_MODE and STATIC_PATH // copy environment (including PATH) then add or replace BUILD_MODE and STATIC_PATH
const env = { const env = {