Merge branch 'pierremtb/issue3528-electron-builder' into pierremtb/issue3528-electron-builder-bump

This commit is contained in:
Pierre Jacquier
2024-09-02 19:02:04 -04:00
3 changed files with 30 additions and 17 deletions

View File

@ -1,4 +1,3 @@
NODE_ENV=production
VITE_KC_API_WS_MODELING_URL=wss://api.zoo.dev/ws/modeling/commands
VITE_KC_API_BASE_URL=https://api.zoo.dev
VITE_KC_SITE_BASE_URL=https://zoo.dev

View File

@ -152,11 +152,13 @@ jobs:
VERSION: ${{ format('v{0}', needs.prepare-files.outputs.version) }}
run: |
for ARCH in arm64 x64; do
TAURI_DIR=out/tauri/$VERSION/macos/$ARCH
TAURI_DIR=out/tauri/$VERSION/macos
TEMP_DIR=temp/$ARCH
mkdir -p $TAURI_DIR
unzip out/*-$ARCH-mac.zip -d $TAURI_DIR
tar -czvf "$TAURI_DIR/Zoo Modeling App.app.tar.gz" -C $TAURI_DIR "Zoo Modeling App.app"
yarn tauri signer sign "$TAURI_DIR/Zoo Modeling App.app.tar.gz"
mkdir -p $TEMP_DIR
unzip out/*-$ARCH-mac.zip -d $TEMP_DIR
tar -czvf "$TAURI_DIR/Zoo Modeling App-$ARCH.app.tar.gz" -C $TEMP_DIR "Zoo Modeling App.app"
yarn tauri signer sign "$TAURI_DIR/Zoo Modeling App-$ARCH.app.tar.gz"
done
ls -R out
@ -264,8 +266,8 @@ jobs:
if: false
run: |
TAURI_DIR=out/tauri/$VERSION
MAC_ARM64_SIG=`cat $TAURI_DIR/macos/arm64/*.app.tar.gz.sig`
MAC_X64_SIG=`cat $TAURI_DIR/macos/x64/*.app.tar.gz.sig`
MAC_ARM64_SIG=`cat $TAURI_DIR/macos/*-arm64.app.tar.gz.sig`
MAC_X64_SIG=`cat $TAURI_DIR/macos/*-x64.app.tar.gz.sig`
WINDOWS_SIG=`cat $TAURI_DIR/nsis/*.nsis.zip.sig`
RELEASE_DIR=https://${WEBSITE_DIR_TAURI}/${VERSION}
jq --null-input \
@ -273,9 +275,9 @@ jobs:
--arg pub_date "${PUB_DATE}" \
--arg notes "${NOTES}" \
--arg mac_arm64_sig "$MAC_ARM64_SIG" \
--arg mac_arm64_url "$RELEASE_DIR/macos/arm64/${{ env.URL_CODED_NAME }}.app.tar.gz" \
--arg mac_arm64_url "$RELEASE_DIR/macos/${{ env.URL_CODED_NAME }}-arm64.app.tar.gz" \
--arg mac_x64_sig "$MAC_X64_SIG" \
--arg mac_x64_url "$RELEASE_DIR/macos/x64/${{ env.URL_CODED_NAME }}.app.tar.gz" \
--arg mac_x64_url "$RELEASE_DIR/macos/${{ env.URL_CODED_NAME }}-x64.app.tar.gz" \
--arg windows_sig "$WINDOWS_SIG" \
--arg windows_url "$RELEASE_DIR/nsis/${{ env.URL_CODED_NAME }}_${VERSION_NO_V}_x64-setup.nsis.zip" \
'{

View File

@ -60,7 +60,7 @@ const createWindow = (): BrowserWindow => {
preload: path.join(__dirname, './preload.js'),
},
icon: path.resolve(process.cwd(), 'assets', 'icon.png'),
frame: false,
// frame: false,
titleBarStyle: 'hiddenInset',
})
@ -199,15 +199,27 @@ export function getAutoUpdater(): AppUpdater {
return autoUpdater
}
export async function checkForUpdates(autoUpdater: AppUpdater) {
// TODO: figure out how to get the update modal back
const result = await autoUpdater.checkForUpdatesAndNotify()
console.log(result)
}
app.on('ready', async () => {
const autoUpdater = getAutoUpdater()
const result = await autoUpdater.checkForUpdates()
console.log(result)
const download = await result?.downloadPromise
console.log(download)
const { response } = await dialog.showMessageBox({ message: "The update will install and the app will reopen" })
console.log(response)
await autoUpdater.quitAndInstall(false)
checkForUpdates(autoUpdater)
const fifteenMinutes = 15 * 60 * 1000
setInterval(() => {
checkForUpdates(autoUpdater)
}, fifteenMinutes)
autoUpdater.on('update-available', (info) => {
console.log('update-available', info)
})
autoUpdater.on('update-downloaded', (info) => {
console.log('update-downloaded', info)
})
})
ipcMain.handle('loadProjectAtStartup', async () => {