From 20dfc4429fda0c2bbd82d1f89ba765fbf1ba0c86 Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Thu, 13 Feb 2020 12:42:46 +0700 Subject: [PATCH] updated and add workflow --- .github/workflows/electron.yml | 52 ++++++++++++++++++++++++++++++++++ main.js | 8 +++++- package.json | 4 ++- 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/electron.yml diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml new file mode 100644 index 0000000..38cc3a7 --- /dev/null +++ b/.github/workflows/electron.yml @@ -0,0 +1,52 @@ +name: Sandbox Clinic Electron CD + +on: [push] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - name: Context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: yarn install + run: | + yarn install + - name: Publish + run: | + yarn run dist + - name: Cleanup artifacts + if: matrix.os != 'windows-latest' + run: | + mkdir artifacts + mv "dist/(*.exe,*.deb,*.AppImage,*.dmg)" artifacts || true + - name: Cleanup artifacts Win + if: matrix.os == 'windows-latest' + run: | + mkdir artifacts + mv dist/*.exe artifacts + - name: Upload artifacts + uses: actions/upload-artifact@v1 + with: + name: ${{matrix.os}} + path: artifacts + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: "artifacts/**" + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/main.js b/main.js index 3835b31..36bb897 100644 --- a/main.js +++ b/main.js @@ -1,7 +1,12 @@ const electron = require("electron"); const { app, BrowserWindow } = electron; +const Store = require("electron-store"); let mainWindow; +const store = new Store(); + +store.set('unicorn', '🦄'); +console.log(store.get('unicorn')); app.on("ready", () => { mainWindow = new BrowserWindow({ @@ -9,7 +14,8 @@ app.on("ready", () => { height: 700 }); - mainWindow.setTitle("CUBETIQ Clinic"); + mainWindow.setFullScreen(true) + mainWindow.setTitle("DR PROFESSIONAL CLINIC"); mainWindow.loadURL("http://clinic.cubetiq.online"); mainWindow.on("closed", () => { diff --git a/package.json b/package.json index df9ebf3..48e8e99 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,9 @@ "icon": "build/icon.ico" } }, - "dependencies": {}, + "dependencies": { + "electron-store": "^5.1.0" + }, "devDependencies": { "electron": "^8.0.0", "electron-builder": "^22.3.2"