Update CI deploy configuration
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- node_modules
|
- node_modules
|
||||||
@@ -21,6 +24,6 @@ script:
|
|||||||
- npm run build
|
- npm run build
|
||||||
- npm run test
|
- npm run test
|
||||||
- if [[ "$TRAVIS_TAG" != "" ]]; then npm run prepare-release; fi
|
- 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 -- 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 ..",
|
"build": "cd app; npm run build; cd ..; cd backend; npm run build; cd ..",
|
||||||
"test-backend": "cd backend && npm run test && cd ..",
|
"test-backend": "cd backend && npm run test && cd ..",
|
||||||
"prepare-release": "./prepare-release.sh",
|
"prepare-release": "./prepare-release.sh",
|
||||||
"package": "ts-node package.ts"
|
"package": "ts-node package.ts",
|
||||||
|
"package-with-docker": "./package-with-docker.sh"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
30
package.ts
30
package.ts
@@ -5,7 +5,17 @@ const linux: builder.CliOptions = {
|
|||||||
ia32: true,
|
ia32: true,
|
||||||
armv7l: true,
|
armv7l: true,
|
||||||
arm64: 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',
|
projectDir: './build/clean',
|
||||||
publish: 'onTag',
|
publish: 'onTag',
|
||||||
}
|
}
|
||||||
@@ -30,7 +40,7 @@ const mac: builder.CliOptions = {
|
|||||||
publish: 'onTag',
|
publish: 'onTag',
|
||||||
}
|
}
|
||||||
|
|
||||||
async function buildAll() {
|
async function executeBuild() {
|
||||||
console.log(process.argv[2])
|
console.log(process.argv[2])
|
||||||
switch (process.argv[2]) {
|
switch (process.argv[2]) {
|
||||||
case 'win':
|
case 'win':
|
||||||
@@ -38,6 +48,11 @@ async function buildAll() {
|
|||||||
break
|
break
|
||||||
case 'linux':
|
case 'linux':
|
||||||
await builder.build(linux)
|
await builder.build(linux)
|
||||||
|
try {
|
||||||
|
await builder.build(linuxSnap)
|
||||||
|
} catch {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
break
|
break
|
||||||
case 'mac':
|
case 'mac':
|
||||||
await builder.build(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