()
| 130 | }) |
| 131 | |
| 132 | function packageApp() { |
| 133 | // not sure if this is needed anywhere, so I'm just going to inline it here |
| 134 | // for now and see what the future brings... |
| 135 | const toPackagePlatform = (platform: NodeJS.Platform) => { |
| 136 | if (platform === 'win32' || platform === 'darwin' || platform === 'linux') { |
| 137 | return platform |
| 138 | } |
| 139 | throw new Error( |
| 140 | `Unable to convert to platform for electron-packager: '${process.platform}` |
| 141 | ) |
| 142 | } |
| 143 | |
| 144 | const toPackageArch = (targetArch: string | undefined): OfficialArch => { |
| 145 | if (targetArch === undefined) { |
| 146 | targetArch = os.arch() |
| 147 | } |
| 148 | |
| 149 | if (targetArch === 'arm64' || targetArch === 'x64') { |
| 150 | return targetArch |
| 151 | } |
| 152 | |
| 153 | throw new Error( |
| 154 | `Building Desktop for architecture '${targetArch}' is not supported` |
| 155 | ) |
| 156 | } |
| 157 | |
| 158 | // get notarization deets, unless we're not going to publish this |
| 159 | const osxNotarize = isPublishableBuild ? getNotarizationOptions() : undefined |
| 160 | |
| 161 | if ( |
| 162 | isPublishableBuild && |
| 163 | isGitHubActions() && |
| 164 | process.platform === 'darwin' && |
| 165 | osxNotarize === undefined |
| 166 | ) { |
| 167 | // we can't publish a mac build without these |
| 168 | throw new Error( |
| 169 | 'Unable to retreive appleId and/or appleIdPassword to notarize macOS build' |
| 170 | ) |
| 171 | } |
| 172 | |
| 173 | const iconPath = getIconDirectory() |
| 174 | const assetsCarPath = join(iconPath, 'Assets.car') |
| 175 | assert( |
| 176 | existsSync(assetsCarPath), |
| 177 | `Unable to find Assets.car at ${assetsCarPath}` |
| 178 | ) |
| 179 | |
| 180 | return packager({ |
| 181 | name: getExecutableName(), |
| 182 | platform: toPackagePlatform(process.platform), |
| 183 | arch: toPackageArch(process.env.TARGET_ARCH), |
| 184 | asar: false, // TODO: Probably wanna enable this down the road. |
| 185 | out: getDistRoot(), |
| 186 | icon: join(iconPath, 'icon-logo'), |
| 187 | extraResource: [assetsCarPath], |
| 188 | dir: outRoot, |
| 189 | overwrite: true, |
no test coverage detected