diff --git a/.travis.yml b/.travis.yml index ae7c2055..11b9c49c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ stages: jobs: include: - stage: 'Build' + if: branch = xxx os: linux before_install: - set -e @@ -39,7 +40,7 @@ jobs: - stage: 'Docs' os: linux - if: branch = xxx + if: branch = master script: - set -e - openssl aes-256-cbc -K $encrypted_4e2fb4889ef8_key -iv $encrypted_4e2fb4889ef8_iv -in .travis.ssh.key.enc -out .travis.ssh.key -d diff --git a/scripts/build-linux.js b/scripts/build-linux.js index 4ad7ff20..6b87f915 100755 --- a/scripts/build-linux.js +++ b/scripts/build-linux.js @@ -2,13 +2,15 @@ const builder = require('electron-builder').build const vars = require('./vars') +const isTag = (process.env.BUILD_SOURCEBRANCH || '').startsWith('refs/tags/') + builder({ - dir: true, - linux: ['snap', 'deb', 'rpm', 'tar.gz'], - config: { - extraMetadata: { - version: vars.version, + dir: true, + linux: ['snap', 'deb', 'rpm', 'tar.gz'], + config: { + extraMetadata: { + version: vars.version, + }, }, - }, - publish: 'onTag', + publish: isTag ? 'always' : 'onTag', }).catch(() => process.exit(1)) diff --git a/scripts/build-macos.js b/scripts/build-macos.js index f2858308..d14c2975 100755 --- a/scripts/build-macos.js +++ b/scripts/build-macos.js @@ -2,13 +2,15 @@ const builder = require('electron-builder').build const vars = require('./vars') +const isTag = (process.env.BUILD_SOURCEBRANCH || '').startsWith('refs/tags/') + builder({ - dir: true, - mac: ['pkg', 'zip'], - config: { - extraMetadata: { - version: vars.version, + dir: true, + mac: ['pkg', 'zip'], + config: { + extraMetadata: { + version: vars.version, + }, }, - }, - publish: 'onTag', + publish: isTag ? 'always' : 'onTag', }).catch(() => process.exit(1)) diff --git a/scripts/build-windows.js b/scripts/build-windows.js index 4b0e6bc3..df741477 100755 --- a/scripts/build-windows.js +++ b/scripts/build-windows.js @@ -2,13 +2,15 @@ const builder = require('electron-builder').build const vars = require('./vars') +const isTag = (process.env.BUILD_SOURCEBRANCH || '').startsWith('refs/tags/') + builder({ - dir: true, - win: ['nsis', 'portable'], - config: { - extraMetadata: { - version: vars.version, + dir: true, + win: ['nsis', 'portable'], + config: { + extraMetadata: { + version: vars.version, + }, }, - }, - publish: 'onTag', + publish: isTag ? 'always' : 'onTag', }).catch(() => process.exit(1))