Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Feb 2, 2025
2 parents 224c824 + fd7b4fa commit 33cc1bd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
echo "sourcename=electron-output/companion-satellite-x64.tar.gz" >> $GITHUB_OUTPUT
echo "targetname=companion-satellite-x64-${COUNT}-${HASH}.tar.gz" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}+${COUNT}-${HASH}" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}-${COUNT}+${HASH}" >> $GITHUB_OUTPUT
- name: Run build
run: |
Expand All @@ -78,9 +78,7 @@ jobs:
yarn
yarn --cwd webui install
yarn dist
env:
BUILD_VERSION: ${{ steps.filenames.outputs.longversion }}
yarn dis
- name: Upload build
uses: bitfocus/actions/upload-and-notify@main
Expand Down Expand Up @@ -134,7 +132,7 @@ jobs:
echo "sourcename=electron-output/companion-satellite-arm64.tar.gz" >> $GITHUB_OUTPUT
echo "targetname=companion-satellite-arm64-${COUNT}-${HASH}.tar.gz" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}+${COUNT}-${HASH}" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}-${COUNT}+${HASH}" >> $GITHUB_OUTPUT
- name: Run build
run: |
Expand All @@ -146,8 +144,6 @@ jobs:
yarn
yarn --cwd webui install
yarn dist linux-arm64
env:
BUILD_VERSION: ${{ steps.filenames.outputs.longversion }}
- name: Upload build
uses: bitfocus/actions/upload-and-notify@main
Expand Down Expand Up @@ -196,7 +192,7 @@ jobs:
echo "sourcename=electron-output/companion-satellite-x64.exe" >> $GITHUB_OUTPUT
echo "targetname=companion-satellite-x64-${COUNT}-${HASH}.exe" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}+${COUNT}-${HASH}" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}-${COUNT}+${HASH}" >> $GITHUB_OUTPUT
- name: Run build
shell: bash
Expand All @@ -217,14 +213,15 @@ jobs:
export EB_UPDATE_CHANNEL=stable
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
export EB_UPDATE_CHANNEL=beta
export BUILD_VERSION=${{ steps.filenames.outputs.longversion }}
elif [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
export EB_UPDATE_CHANNEL=experimental
export BUILD_VERSION=${{ steps.filenames.outputs.longversion }}
fi
yarn dist win32-x64
env:
CI: 1
BUILD_VERSION: ${{ steps.filenames.outputs.longversion }}

- name: build & package (signed)
if: ${{ runner.environment == 'self-hosted' }}
Expand All @@ -234,8 +231,10 @@ jobs:
export EB_UPDATE_CHANNEL=stable
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
export EB_UPDATE_CHANNEL=beta
export BUILD_VERSION=${{ steps.filenames.outputs.longversion }}
elif [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
export EB_UPDATE_CHANNEL=experimental
export BUILD_VERSION=${{ steps.filenames.outputs.longversion }}
fi
yarn dist win32-x64
env:
Expand Down Expand Up @@ -290,7 +289,7 @@ jobs:
echo "sourcename=electron-output/companion-satellite-x64.dmg" >> $GITHUB_OUTPUT
echo "targetname=companion-satellite-x64-${COUNT}-${HASH}.dmg" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}+${COUNT}-${HASH}" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}-${COUNT}+${HASH}" >> $GITHUB_OUTPUT
- name: Run build
shell: bash
Expand All @@ -304,8 +303,10 @@ jobs:
export EB_UPDATE_CHANNEL=stable
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
export EB_UPDATE_CHANNEL=beta
export BUILD_VERSION=${{ steps.filenames.outputs.longversion }}
elif [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
export EB_UPDATE_CHANNEL=experimental
export BUILD_VERSION=${{ steps.filenames.outputs.longversion }}
fi
yarn
Expand All @@ -317,7 +318,6 @@ jobs:
APPLE_ID: ${{ secrets.APPLEID }}
APPLE_TEAM_ID: ${{ secrets.APPLETEAMID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLEIDPASS }}
BUILD_VERSION: ${{ steps.filenames.outputs.longversion }}

- name: Upload build
uses: bitfocus/actions/upload-and-notify@main
Expand Down Expand Up @@ -366,7 +366,7 @@ jobs:
echo "sourcename=electron-output/companion-satellite-arm64.dmg" >> $GITHUB_OUTPUT
echo "targetname=companion-satellite-arm64-${COUNT}-${HASH}.dmg" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}+${COUNT}-${HASH}" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}-${COUNT}+${HASH}" >> $GITHUB_OUTPUT
- name: Run build
shell: bash
Expand All @@ -380,8 +380,10 @@ jobs:
export EB_UPDATE_CHANNEL=stable
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
export EB_UPDATE_CHANNEL=beta
export BUILD_VERSION=${{ steps.filenames.outputs.longversion }}
elif [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
export EB_UPDATE_CHANNEL=experimental
export BUILD_VERSION=${{ steps.filenames.outputs.longversion }}
fi
yarn
Expand All @@ -393,7 +395,6 @@ jobs:
APPLE_ID: ${{ secrets.APPLEID }}
APPLE_TEAM_ID: ${{ secrets.APPLETEAMID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLEIDPASS }}
BUILD_VERSION: ${{ steps.filenames.outputs.longversion }}

- name: Upload build
uses: bitfocus/actions/upload-and-notify@main
Expand Down Expand Up @@ -449,7 +450,7 @@ jobs:
echo "sourcename=pi-image/output-satellitepi/image.gz" >> $GITHUB_OUTPUT
echo "targetname=companion-satellite-pi-${COUNT}-${HASH}.img.gz" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}+${COUNT}-${HASH}" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}-${COUNT}+${HASH}" >> $GITHUB_OUTPUT
echo "shortversion=v${VERSION}" >> $GITHUB_OUTPUT
- name: install packer
Expand Down
9 changes: 5 additions & 4 deletions satellite/src/electronUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ export class ElectronUpdater {
autoUpdater
.checkForUpdates()
.then((info) => {
// HACK: If there is a cancellation token, it found an update.
// This is not a good test, but the only other ways require comparing version numbers the same as electron-updater, or to listen to the emitted events instead
const hasUpdate = !!info?.cancellationToken
if (notifyWithDialog) {
// HACK: If there is a cancellation token, it found an update.
// This is not a good test, but the only other ways require comparing version numbers the same as electron-updater, or to listen to the emitted events instead
if (info?.cancellationToken) {
if (hasUpdate) {
dialog
.showMessageBox({
title: 'Companion Satellite',
Expand Down Expand Up @@ -95,7 +96,7 @@ export class ElectronUpdater {
}
} else {
// Show a system notification instead
if (info) {
if (hasUpdate) {
if (!this.#updateNotification) {
this.#updateNotification = new Notification({
title: 'An update is available',
Expand Down

0 comments on commit 33cc1bd

Please sign in to comment.