2017-04-30 22:01:12 +00:00
|
|
|
#!/usr/bin/env node
|
2022-06-02 18:15:30 +00:00
|
|
|
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
2017-04-30 22:01:12 +00:00
|
|
|
const builder = require('electron-builder').build
|
|
|
|
const vars = require('./vars')
|
|
|
|
|
2019-08-27 08:33:30 +00:00
|
|
|
const isTag = (process.env.GITHUB_REF || process.env.BUILD_SOURCEBRANCH || '').startsWith('refs/tags/')
|
2019-07-04 12:08:47 +00:00
|
|
|
|
2022-03-09 05:49:04 +00:00
|
|
|
process.env.ARCH = process.env.ARCH || process.arch
|
|
|
|
|
2017-04-30 22:01:12 +00:00
|
|
|
builder({
|
2019-07-04 12:08:47 +00:00
|
|
|
dir: true,
|
2020-02-12 17:48:18 +00:00
|
|
|
win: ['nsis', 'zip'],
|
2022-03-09 05:49:04 +00:00
|
|
|
arm64: process.env.ARCH === 'arm64',
|
2019-07-04 12:08:47 +00:00
|
|
|
config: {
|
|
|
|
extraMetadata: {
|
|
|
|
version: vars.version,
|
|
|
|
},
|
2022-06-30 07:15:02 +00:00
|
|
|
publish: process.env.GH_TOKEN ? {
|
2022-06-02 18:15:30 +00:00
|
|
|
provider: 'github',
|
|
|
|
channel: `latest-${process.arch}`,
|
2022-06-30 07:15:02 +00:00
|
|
|
} : undefined,
|
2018-08-09 19:47:38 +00:00
|
|
|
},
|
2022-06-02 18:15:30 +00:00
|
|
|
publish: isTag ? 'always' : 'onTagOrDraft',
|
2019-06-27 09:47:57 +00:00
|
|
|
}).catch(() => process.exit(1))
|