Update CI deploy configuration
This commit is contained in:
@@ -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
702
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
9
package-with-docker.sh
Executable file
9
package-with-docker.sh
Executable 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 $@
|
||||
@@ -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",
|
||||
|
||||
30
package.ts
30
package.ts
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user