Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/release.yml
#	README.md
#	package-lock.json
#	package.json
#	src/app.vue
#	src/background.ts
#	src/components/settings.vue
#	src/services/heartbeat.ts
#	vue.config.js
  • Loading branch information
kmteras committed Sep 26, 2019
2 parents e158546 + 63a5ec8 commit 52bdbac
Show file tree
Hide file tree
Showing 13 changed files with 313 additions and 32 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Mac release

on: [release]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]

steps:
- uses: actions/checkout@v1
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Dump runner context
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
- name: Windows build tools
if: runner.os == 'Windows'
run: npm install --vs2015 --global windows-build-tools
- name: Download newer npm
if: runner.os == 'Windows'
run: npm install npm@next -g
- name: npm install
run: npm ci --prefer-offline --no-audit
- name: npm lint
run: npm run lint
- name: npm build
run: npm run build
- name: Release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
CSC_LINK: ${{ secrets.CSC_LINK_MAC }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD_MAC }}
run: npm run release
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# timenaut
# Timenaut

![dashboard](/docs/dashboard.png)

![processes](/docs/processes.png)

## Downloading

Expand Down
36 changes: 36 additions & 0 deletions build/afterSignHook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// See: https://medium.com/@TwitterArchiveEraser/notarize-electron-apps-7a5f988406db

const fs = require('fs');
const path = require('path');
var electron_notarize = require('electron-notarize');

module.exports = async function (params) {
// Only notarize the app on Mac OS only.
if (process.platform !== 'darwin') {
return;
}
console.log('afterSign hook triggered', params);

// Same appId in electron-builder.
let appId = 'app.timenaut.timenaut'

let appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`);
if (!fs.existsSync(appPath)) {
throw new Error(`Cannot find application at: ${appPath}`);
}

console.log(`Notarizing ${appId} found at ${appPath}`);

try {
await electron_notarize.notarize({
appBundleId: appId,
appPath: appPath,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD,
});
} catch (error) {
console.error(error);
}

console.log(`Done notarizing ${appId}`);
};
26 changes: 26 additions & 0 deletions build/timenaut.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.automation.apple-events</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.debugger</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
</dict>
</plist>
Binary file added docs/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/processes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 79 additions & 4 deletions package-lock.json

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

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "timenaut",
"version": "0.0.9",
"version": "0.1.0",
"author": "Karl Martin Teras",
"description": "Timenaut is software to monitor your computer usage and give you feedback to help you improve.",
"private": true,
Expand All @@ -26,11 +26,13 @@
"vue-class-component": "^7.0.2",
"vue-property-decorator": "^8.1.0",
"auto-launch": "^5.0.5",
"electron-updater": "^4.1.2"
"electron-updater": "^4.1.2",
"node-schedule": "^1.3.2"
},
"devDependencies": {
"@types/better-sqlite3": "^5.4.0",
"@types/auto-launch": "^5.0.1",
"@types/better-sqlite3": "^5.4.0",
"@types/node-schedule": "^1.2.4",
"@vue/cli-plugin-babel": "^3.10.0",
"@vue/cli-plugin-eslint": "^3.10.0",
"@vue/cli-plugin-typescript": "^3.10.0",
Expand All @@ -40,6 +42,7 @@
"electron": "^6.0.0",
"electron-icon-builder": "^1.0.1",
"electron-log": "^3.0.7",
"electron-notarize": "^0.1.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"typescript": "^3.4.3",
Expand Down
31 changes: 30 additions & 1 deletion src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import Updatable from "@/components/updatable";
interface PageComponent {
new (): Updatable;
new(): Updatable;
}
type NavigationItem = {
Expand Down Expand Up @@ -99,4 +99,33 @@
.bold {
font-weight: bold;
}
input[type=text],
input[type=number],
input[type=password]
{
padding-top: 8px;
padding-bottom: 8px;
border-width: 1px;
border-radius: 4px;
border-color: #cbd5e0;
border-style: solid;
line-height: 1.25;
color: #2d3748;
font-size: 16px;
padding-left: 12px;
padding-right: 12px;
margin-left: 10px;
box-shadow: 0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px 0 rgba(0,0,0,.06);
height: 35px;
}
input[type=checkbox]{
margin-left: 12px;
position: absolute;
cursor: pointer;
width: 18px;
height: 18px;
}
</style>
9 changes: 9 additions & 0 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import AutoLaunch from 'auto-launch';
import path from 'path';
import log from 'electron-log'
import Settings from "@/services/settings";
import {scheduleJob} from 'node-schedule'

const isDevelopment = process.env.NODE_ENV !== 'production';

Expand Down Expand Up @@ -49,6 +50,12 @@ let menuItems = [
{
type: 'separator'
},
{
label: "Check for updates",
click() {
autoUpdaterService.check();
}
},
{
label: 'Quit',
click() {
Expand Down Expand Up @@ -127,6 +134,8 @@ async function createWindow() {

autoUpdaterService.check();

scheduleJob("* * 14 * *", autoUpdaterService.check);

autoLauncher = new AutoLaunch(autostartOptions);

if (process.env.WEBPACK_DEV_SERVER_URL) {
Expand Down
Loading

0 comments on commit 52bdbac

Please sign in to comment.