add CircleCI build config for Windows

This commit is contained in:
Christopher Willis-Ford 2020-01-13 19:11:56 -08:00
parent 43daa269df
commit ff53e9822a
2 changed files with 40 additions and 0 deletions

38
.circleci/config.yml Normal file
View file

@ -0,0 +1,38 @@
version: 2.1
workflows:
windows:
jobs:
- build_for_windows:
context: code-sign-generic
orbs:
windows: circleci/windows@2.2.0
jobs:
build_for_windows:
executor:
name: windows/default
shell: bash.exe
steps:
- checkout
- restore_cache:
keys:
- npm-cache-{{ 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-{{ 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
- run:
name: Move build products to artifacts directory
command: |
mkdir -p Artifacts/
mv dist/{Scratch*.appx,Scratch*.exe} Artifacts/
- store_artifacts:
path: Artifacts/

View file

@ -9,6 +9,8 @@
"start": "electron-webpack dev --bail --display-error-details --env.minify=false",
"build-gui": "node ./scripts/run-in-gui.js build",
"watch-gui": "node ./scripts/run-in-gui.js watch",
"delete-gui": "rimraf ./node_modules/scratch-gui",
"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",
"fetch": "rimraf ./static/assets/ && mkdirp ./static/assets/ && node ./scripts/fetchMediaLibraryAssets.js",