tabby/scripts/build-linux.js

32 lines
963 B
JavaScript
Raw Normal View History

2017-05-01 11:35:26 +00:00
#!/usr/bin/env node
2022-06-02 18:15:30 +00:00
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
2017-05-01 11:35:26 +00:00
const builder = require('electron-builder').build
const vars = require('./vars')
2019-08-26 20:38:13 +00:00
const isTag = (process.env.GITHUB_REF || '').startsWith('refs/tags/')
2019-07-04 12:08:47 +00:00
2022-06-02 18:15:30 +00:00
process.env.ARCH = (process.env.ARCH || process.arch) === 'arm' ? 'armv7l' : process.env.ARCH || process.arch
2022-03-09 05:05:37 +00:00
2017-05-01 11:35:26 +00:00
builder({
2019-07-04 12:08:47 +00:00
dir: true,
2021-05-02 18:02:46 +00:00
linux: ['deb', 'tar.gz', 'rpm', 'pacman'],
2022-04-25 05:49:30 +00:00
armv7l: process.env.ARCH === 'armv7l',
2022-03-09 05:05:37 +00:00
arm64: process.env.ARCH === 'arm64',
2019-07-04 12:08:47 +00:00
config: {
extraMetadata: {
version: vars.version,
},
2022-10-01 13:40:50 +00:00
publish: process.env.KEYGEN_TOKEN ? [
vars.keygenConfig,
{
provider: 'github',
channel: `latest-${process.env.ARCH}`,
},
] : undefined,
2022-10-01 11:04:55 +00:00
},
publish: process.env.KEYGEN_TOKEN ? isTag ? 'always' : 'onTagOrDraft' : 'never',
2022-08-30 06:16:27 +00:00
}).catch(e => {
console.error(e)
process.exit(1)
})