tabby/scripts/build-windows.js

31 lines
875 B
JavaScript
Raw Normal View History

2017-05-01 06:01:12 +08:00
#!/usr/bin/env node
2022-06-03 02:15:30 +08:00
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
2017-05-01 06:01:12 +08:00
const builder = require('electron-builder').build
const vars = require('./vars')
2019-08-27 16:33:30 +08:00
const isTag = (process.env.GITHUB_REF || process.env.BUILD_SOURCEBRANCH || '').startsWith('refs/tags/')
2019-07-04 20:08:47 +08:00
2022-03-09 13:49:04 +08:00
process.env.ARCH = process.env.ARCH || process.arch
2017-05-01 06:01:12 +08:00
builder({
2019-07-04 20:08:47 +08:00
dir: true,
win: ['nsis', 'zip'],
2022-03-09 13:49:04 +08:00
arm64: process.env.ARCH === 'arm64',
2019-07-04 20:08:47 +08:00
config: {
extraMetadata: {
version: vars.version,
},
2022-10-01 21:40:50 +08:00
publish: process.env.KEYGEN_TOKEN ? [
vars.keygenConfig,
{
provider: 'github',
channel: `latest-${process.env.ARCH}`,
},
] : undefined,
2018-08-10 03:47:38 +08:00
},
2022-10-01 19:04:55 +08:00
publish: process.env.KEYGEN_TOKEN ? isTag ? 'always' : 'onTagOrDraft' : 'never',
2022-08-30 14:15:29 +08:00
}).catch(e => {
console.error(e)
process.exit(1)
})