tabby/scripts/build-macos.js

41 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-05-01 14:01:14 +00:00
#!/usr/bin/env node
2022-06-02 18:15:30 +00:00
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
2017-05-01 14:01:14 +00:00
const builder = require('electron-builder').build
const vars = require('./vars')
2019-08-15 13:17:15 +00:00
const isTag = (process.env.GITHUB_REF || '').startsWith('refs/tags/')
2019-07-04 12:08:47 +00:00
2020-12-24 17:18:07 +00:00
process.env.ARCH = process.env.ARCH || process.arch
2021-05-24 21:30:05 +00:00
if (process.env.GITHUB_HEAD_REF) {
delete process.env.CSC_LINK
delete process.env.CSC_KEY_PASSWORD
process.env.CSC_IDENTITY_AUTO_DISCOVERY = 'false'
}
2017-05-01 14:01:14 +00:00
builder({
2019-07-04 12:08:47 +00:00
dir: true,
mac: ['pkg', 'zip'],
2020-12-24 17:18:07 +00:00
arm64: process.env.ARCH === 'arm64',
2019-07-04 12:08:47 +00:00
config: {
extraMetadata: {
version: vars.version,
},
2021-06-19 18:10:34 +00:00
mac: {
identity: !process.env.CI || process.env.CSC_LINK ? undefined : null,
},
2021-01-26 23:26:48 +00:00
npmRebuild: process.env.ARCH !== 'arm64',
2022-10-01 11:04:55 +00:00
publish: process.env.KEYGEN_TOKEN ? {
product: {
arm64: '98fbadee-c707-4cd6-9d99-56683595a846',
x86_64: 'f5a48841-d5b8-4b7b-aaa7-cf5bffd36461',
}[process.env.ARCH],
...vars.keygenConfig,
2022-06-30 07:15:02 +00:00
} : undefined,
2018-08-09 19:47:38 +00:00
},
2022-10-01 11:04:55 +00:00
publish: process.env.KEYGEN_TOKEN ? isTag ? 'always' : 'onTagOrDraft' : 'never',
2020-05-07 15:37:39 +00:00
}).catch(e => {
console.error(e)
process.exit(1)
})