Skip to content

Commit

Permalink
feat(client-electron): add auto update
Browse files Browse the repository at this point in the history
fixes #110
fixes #128
  • Loading branch information
marcincichocki authored Aug 22, 2021
1 parent 568c7f3 commit 00d0bca
Show file tree
Hide file tree
Showing 13 changed files with 445 additions and 25 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@ on:
- 'v*.*.*'
jobs:
build:
runs-on: windows-2019
strategy:
matrix:
platform: [ubuntu-latest, windows-2019]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm ci
- run: npm test
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
github_token: ${{ secrets.github_token }}
release: true
build_script_name: webpack:build
1 change: 1 addition & 0 deletions configs/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const commonPlugins: WebpackPluginInstance[] = [
HOMEPAGE_URL: JSON.stringify(pkg.homepage),
BUGS_URL: JSON.stringify(pkg.bugs),
PRODUCT_NAME: JSON.stringify(pkg.build.productName),
APP_ID: JSON.stringify(pkg.build.appId),
BUILD_PLATFORM: JSON.stringify(process.platform),
}),
new LicenseWebpackPlugin({
Expand Down
220 changes: 208 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"target": "nsis"
},
"linux": {
"target": "AppImage",
"asarUnpack": [
"node_modules/sharp"
]
Expand Down Expand Up @@ -98,6 +99,8 @@
"date-fns": "^2.22.1",
"electron-is-accelerator": "^0.2.0",
"electron-store": "^8.0.0",
"electron-updater": "^4.3.9",
"is-electron-renderer": "^2.0.1",
"is-wsl": "^2.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
9 changes: 9 additions & 0 deletions src/electron/common/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
AppSettings,
HistoryEntry,
Origin,
UpdateStatus,
WorkerStatus,
} from './common';

Expand All @@ -14,6 +15,7 @@ export const ActionTypes = {
UPDATE_SETTINGS: 'UPDATE_SETTINGS',
REMOVE_LAST_N_HISTORY_ENTRIES: 'REMOVE_LAST_N_HISTORY_ENTRIES',
REMOVE_HISTORY_ENTRY: 'REMOVE_HISTORY_ENTRY',
SET_UPDATE_STATUS: 'SET_UPDATE_STATUS',
} as const;

export class SetStatusAction implements Action {
Expand Down Expand Up @@ -64,3 +66,10 @@ export class RemoveHistoryEntryAction implements Action {

constructor(public readonly payload: string) {}
}

export class SetUpdateStatusAction implements Action {
readonly type = ActionTypes.SET_UPDATE_STATUS;
readonly origin: Origin = null;

constructor(public readonly payload: UpdateStatus) {}
}
Loading

0 comments on commit 00d0bca

Please sign in to comment.