Update CI deploy configuration

This commit is contained in:
Thomas Nordquist
2019-01-14 14:06:12 +01:00
parent d4bb00262e
commit ac2387ed9b
5 changed files with 275 additions and 476 deletions

View File

@@ -1,5 +1,8 @@
language: node_js
services:
- docker
cache:
directories:
- node_modules
@@ -21,6 +24,6 @@ script:
- npm run build
- npm run test
- if [[ "$TRAVIS_TAG" != "" ]]; then npm run prepare-release; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$TRAVIS_TAG" != "" ]]; then npm run package -- linux; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$TRAVIS_TAG" != "" ]]; then npm run package-with-docker -- linux; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$TRAVIS_TAG" != "" ]]; then npm run package -- mac; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$TRAVIS_TAG" != "" ]]; then npm run package -- win; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$TRAVIS_TAG" != "" ]]; then npm run package-with-docker -- win; fi

702
package-lock.json generated

File diff suppressed because it is too large Load Diff

9
package-with-docker.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
docker run --rm -ti \
--env ELECTRON_CACHE="/root/.cache/electron" \
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
--env GH_TOKEN="$GH_TOKEN" \
-v ${PWD}:/project \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:wine node_modules/.bin/ts-node package.ts $@

View File

@@ -10,7 +10,8 @@
"build": "cd app; npm run build; cd ..; cd backend; npm run build; cd ..",
"test-backend": "cd backend && npm run test && cd ..",
"prepare-release": "./prepare-release.sh",
"package": "ts-node package.ts"
"package": "ts-node package.ts",
"package-with-docker": "./package-with-docker.sh"
},
"repository": {
"type": "git",

View File

@@ -5,7 +5,17 @@ const linux: builder.CliOptions = {
ia32: true,
armv7l: true,
arm64: true,
linux: ['AppImage', 'deb', 'snap'],
linux: ['AppImage', 'deb', 'rpm', 'pacman', 'tar.gz'],
projectDir: './build/clean',
publish: 'onTag',
}
const linuxSnap: builder.CliOptions = {
x64: false,
ia32: false,
armv7l: false,
arm64: true,
linux: ['snap'],
projectDir: './build/clean',
publish: 'onTag',
}
@@ -30,7 +40,7 @@ const mac: builder.CliOptions = {
publish: 'onTag',
}
async function buildAll() {
async function executeBuild() {
console.log(process.argv[2])
switch (process.argv[2]) {
case 'win':
@@ -38,6 +48,11 @@ async function buildAll() {
break
case 'linux':
await builder.build(linux)
try {
await builder.build(linuxSnap)
} catch {
// ignore
}
break
case 'mac':
await builder.build(mac)
@@ -47,4 +62,13 @@ async function buildAll() {
}
}
buildAll()
function build() {
try {
executeBuild()
} catch (error) {
console.error(error)
process.exit(1)
}
}
build()