use docker for windows

pull/432/head
Lex Neva 2019-04-12 01:41:14 -04:00
rodzic 9091be8b97
commit 0d54c828d0
7 zmienionych plików z 5228 dodań i 10512 usunięć

Wyświetl plik

@ -23,6 +23,7 @@ matrix:
- python: 2.7 - python: 2.7
sudo: required sudo: required
env: BUILD=windows env: BUILD=windows
services: docker
if: type != cron AND (tag =~ ^v[0-9.]+$ OR branch != master) if: type != cron AND (tag =~ ^v[0-9.]+$ OR branch != master)
- language: generic - language: generic
os: osx os: osx
@ -42,7 +43,6 @@ cache:
- $HOME/.cache/pip - $HOME/.cache/pip
- electron/node_modules - electron/node_modules
- $HOME/.cache/electron - $HOME/.cache/electron
- $HOME/.cache/electron-builder
- /var/cache/apt/archives - /var/cache/apt/archives
install: install:
- | - |
@ -107,10 +107,6 @@ install:
wine c:\\Python\\python.exe c:\\Python\\scripts\\pip.exe install -r requirements.txt wine c:\\Python\\python.exe c:\\Python\\scripts\\pip.exe install -r requirements.txt
wget -q https://nodejs.org/dist/v10.15.3/node-v10.15.3-win-x86.zip --output-document=node.zip
unzip node.zip
mv node-v*-win-x86 $(winepath 'C:\node')
set +x set +x
elif [ "$BUILD" = "osx" ]; then elif [ "$BUILD" = "osx" ]; then
set -x set -x

Wyświetl plik

@ -16,7 +16,7 @@ dist: distclean locales inx
cp -a icons dist/inkstitch/bin cp -a icons dist/inkstitch/bin
cp -a locales dist/inkstitch/bin cp -a locales dist/inkstitch/bin
cp -a print dist/inkstitch/bin cp -a print dist/inkstitch/bin
cp -a electron/out/* dist/inkstitch/electron cp -a electron/dist/*-unpacked dist/inkstitch/electron
if [ "$$BUILD" = "windows" ]; then \ if [ "$$BUILD" = "windows" ]; then \
cd dist; zip -r ../inkstitch-$(VERSION)-win32.zip *; \ cd dist; zip -r ../inkstitch-$(VERSION)-win32.zip *; \
else \ else \

Wyświetl plik

@ -1,13 +1,14 @@
#!/bin/bash #!/bin/bash
cd electron
if [ "$BUILD" = "windows" ]; then if [ "$BUILD" = "windows" ]; then
NPM="wine cmd /c C:\\node\\npm.cmd" docker run --rm \
-e ELECTRON_CACHE=$HOME/.cache/electron \
-v ${PWD}/electron:/project \
-v ~/.cache/electron:/root/.cache/electron \
electronuserland/builder:wine \
/bin/bash -c "yarn --link-duplicates --pure-lockfile && yarn run dist"
else else
NPM="npm" cd electron
yarn install
yarn run dist
fi fi
$NPM install
$NPM update
$NPM run package

10444
electron/package-lock.json wygenerowano

Plik diff jest za duży Load Diff

Wyświetl plik

@ -5,60 +5,22 @@
"description": "Ink/Stitch GUI", "description": "Ink/Stitch GUI",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {
"start": "electron-forge start", "pack": "electron-builder --dir",
"package": "electron-forge package", "dist": "electron-builder"
"make": "electron-forge make", },
"publish": "electron-forge publish", "build": {
"lint": "eslint src --color" "linux": { "target": "dir" }
}, },
"keywords": [], "keywords": [],
"author": "lex", "author": "lex",
"license": "GPLv3", "license": "GPL-3.0-or-later",
"config": {
"forge": {
"make_targets": {
"win32": [
"squirrel"
],
"darwin": [
"dmg"
],
"linux": [
"deb"
]
},
"electronPackagerConfig": {
"packageManager": "npm"
},
"electronWinstallerConfig": {
"name": "inkstitch"
},
"electronInstallerDebian": {},
"electronInstallerRedhat": {},
"github_repository": {
"owner": "",
"name": ""
},
"windowsStoreConfig": {
"packageName": "",
"name": "inkstitch"
}
}
},
"dependencies": { "dependencies": {
"electron-compile": "^6.4.4", "electron-compile": "^6.4.4"
"electron-squirrel-startup": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"babel-plugin-transform-async-to-generator": "^6.24.1", "electron": "4.1.3",
"babel-preset-env": "^1.7.0", "electron-builder": "^20.39.0",
"babel-preset-react": "^6.24.1", "electron-packager": "13.1.1",
"electron-forge": "^5.2.4", "electron-prebuilt-compile": "4.0.0"
"electron-prebuilt-compile": "4.0.0",
"eslint": "^3.19.0",
"eslint-config-airbnb": "^15.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.12.4"
} }
} }

5201
electron/yarn.lock 100644

Plik diff jest za duży Load Diff

Wyświetl plik

@ -1,3 +1,4 @@
from glob import glob
import os import os
import subprocess import subprocess
import sys import sys
@ -16,13 +17,12 @@ def open_url(url):
else: else:
# It's a bit trickier to find the electron app in a development environment. # It's a bit trickier to find the electron app in a development environment.
base_dir = get_bundled_dir("electron") base_dir = get_bundled_dir("electron")
package_dir = glob(os.path.join(base_dir, 'dist', '*-unpacked'))
try: if not package_dir:
package_dir = os.listdir(os.path.join(base_dir, "out"))[0] raise Exception("Electron app not found. Be sure to run 'yarn; yarn dist' in %s." % base_dir)
except (OSError, IndexError):
raise Exception("Electron app not found. Be sure to run 'npm install; npm run package' in %s." % base_dir)
electron_path = os.path.join(base_dir, "out", package_dir, "inkstitch-gui") electron_path = os.path.join(base_dir, package_dir, "inkstitch-gui")
if sys.platform == "darwin": if sys.platform == "darwin":
electron_path += ".app/Contents/MacOS/inkstitch-gui" electron_path += ".app/Contents/MacOS/inkstitch-gui"