1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-22 20:55:03 +03:00
tabby/scripts/build-windows.mjs

31 lines
881 B
JavaScript
Raw Normal View History

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