mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-15 16:09:56 +00:00
wip
This commit is contained in:
parent
93c9bc67bc
commit
324ca6ed82
16
build/mac/afterBuildHook.cjs
Normal file
16
build/mac/afterBuildHook.cjs
Normal file
@ -0,0 +1,16 @@
|
||||
const fs = require('fs')
|
||||
const signHook = require('./afterSignHook.cjs')
|
||||
|
||||
module.exports = async function (params) {
|
||||
// notarize the app on Mac OS only.
|
||||
if (process.platform !== 'darwin' || !process.env.GITHUB_REF || !process.env.GITHUB_REF.startsWith('refs/tags/')) {
|
||||
return
|
||||
}
|
||||
console.log('afterBuild hook triggered')
|
||||
|
||||
let pkgName = fs.readdirSync('dist').find(x => x.endsWith('.pkg'))
|
||||
signHook({
|
||||
appOutDir: 'dist',
|
||||
_pathOverride: pkgName,
|
||||
})
|
||||
}
|
35
build/mac/afterSignHook.cjs
Normal file
35
build/mac/afterSignHook.cjs
Normal file
@ -0,0 +1,35 @@
|
||||
// See: https://medium.com/@TwitterArchiveEraser/notarize-electron-apps-7a5f988406db
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const notarizer = require('electron-notarize')
|
||||
|
||||
module.exports = async function (params) {
|
||||
// notarize the app on Mac OS only.
|
||||
if (process.platform !== 'darwin' || !process.env.GITHUB_REF || !process.env.GITHUB_REF.startsWith('refs/tags/')) {
|
||||
return
|
||||
}
|
||||
console.log('afterSign hook triggered', params)
|
||||
|
||||
let appId = 'org.tabby'
|
||||
|
||||
let appPath = path.join(params.appOutDir, params._pathOverride || `${params.packager.appInfo.productFilename}.app`)
|
||||
if (!fs.existsSync(appPath)) {
|
||||
throw new Error(`Cannot find application at: ${appPath}`)
|
||||
}
|
||||
|
||||
console.log(`Notarizing ${appId} found at ${appPath}`)
|
||||
|
||||
try {
|
||||
await notarizer.notarize({
|
||||
appBundleId: appId,
|
||||
appPath: appPath,
|
||||
appleId: process.env.APPSTORE_USERNAME,
|
||||
appleIdPassword: process.env.APPSTORE_PASSWORD,
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
console.log(`Done notarizing ${appId}`)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user