Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 3c8619c

Browse files
committed
first commit
1 parent 8b67cc8 commit 3c8619c

File tree

6 files changed

+2858
-0
lines changed

6 files changed

+2858
-0
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build/release
2+
3+
on: push
4+
5+
jobs:
6+
release:
7+
runs-on: ${{ matrix.os }}
8+
9+
strategy:
10+
matrix:
11+
os: [macos-latest, ubuntu-latest, windows-latest]
12+
13+
steps:
14+
- name: Check out Git repository
15+
uses: actions/checkout@v1
16+
17+
- name: Install Node.js, NPM and Yarn
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: 14
21+
22+
- name: Build/release Electron app
23+
uses: samuelmeuli/action-electron-builder@v1
24+
with:
25+
# GitHub token, automatically provided to the action
26+
# (No need to define this secret in the repo settings)
27+
github_token: ${{ secrets.github_token }}
28+
29+
# If the commit is tagged with a version (e.g. "v1.0.0"),
30+
# release the app after building
31+
release: ${{ startsWith(github.ref, 'refs/tags/v') }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,7 @@ dist
102102

103103
# TernJS port file
104104
.tern-port
105+
106+
*~
107+
108+
.DS_Store

app.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { app, BrowserWindow } from "electron";
2+
import { autoUpdater } from "electron-updater";
3+
4+
export class Main {
5+
static mainWindow: Electron.BrowserWindow;
6+
static application: Electron.App;
7+
static BrowserWindow;
8+
private static onWindowAllClosed() {
9+
if (process.platform !== "darwin") {
10+
Main.application.quit();
11+
}
12+
}
13+
14+
private static onClose() {
15+
// Dereference the window object.
16+
Main.mainWindow = null;
17+
}
18+
19+
private static onReady() {
20+
Main.mainWindow = new Main.BrowserWindow({ width: 800, height: 600 });
21+
Main.mainWindow.loadURL("file://" + __dirname + "/index.html");
22+
Main.mainWindow.on("closed", Main.onClose);
23+
}
24+
25+
static main(app: Electron.App, browserWindow: typeof BrowserWindow) {
26+
// we pass the Electron.App object and the
27+
// Electron.BrowserWindow into this function
28+
// so this class has no dependencies. This
29+
// makes the code easier to write tests for
30+
Main.BrowserWindow = browserWindow;
31+
Main.application = app;
32+
Main.application.on("window-all-closed", Main.onWindowAllClosed);
33+
Main.application.on("ready", Main.onReady);
34+
Main.application.on("ready", () => {
35+
autoUpdater.checkForUpdatesAndNotify();
36+
});
37+
}
38+
}
39+
40+
Main.main(app, BrowserWindow);

0 commit comments

Comments
 (0)