Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and improve auto update #49

Merged
merged 26 commits into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
72cf64b
Try to fix auto update
fdaveine Oct 27, 2020
a00768b
Update CI conf to debug auto update
fdaveine Oct 27, 2020
04f3420
Update CI conf to debug auto update (2)
fdaveine Oct 27, 2020
03a9b05
Bump version
fdaveine Oct 27, 2020
8838455
Update location for `buildResources` and `output` electron-build sett…
fdaveine Oct 30, 2020
f107b45
Add a menu bar (hidden by default, hit `alt` to show it) that allow t…
fdaveine Oct 30, 2020
d23c3db
Update outdated comment
fdaveine Oct 30, 2020
4bdd00a
update `electron-log` dependency
fdaveine Oct 30, 2020
6a63aba
Add a `SplashScreenPage.vue`, it is displayed before login page and a…
fdaveine Oct 30, 2020
540fa27
Add/improve instructions to debug app inside `README.md` [skip ci]
fdaveine Oct 30, 2020
d8b9094
Try to fix logs folder path on macOS
fdaveine Oct 30, 2020
6f7580f
Remove log added for debug
fdaveine Oct 31, 2020
ea2a3c4
Fix auto update on macOS
fdaveine Nov 1, 2020
0c5598a
Update readme.md (remove unnecessary step)
fdaveine Nov 1, 2020
cb600c0
Check CI run properly
fdaveine Nov 1, 2020
c89754e
Check CI run properly (2)
fdaveine Nov 1, 2020
35c86aa
Check CI run properly (3)
fdaveine Nov 1, 2020
d909f31
Check CI run properly (4)
fdaveine Nov 1, 2020
f6ae2ae
Check CI run properly (5)
fdaveine Nov 1, 2020
12f9281
Check CI run properly (6)
fdaveine Nov 1, 2020
7c04bb3
Remove CI unused CI files
fdaveine Nov 2, 2020
4fc6273
Restore proper CI config
fdaveine Nov 2, 2020
107e35e
Fix/update Debug update process
fdaveine Nov 2, 2020
2e65376
Update comments
fdaveine Nov 2, 2020
8219caf
Add logic to skip full update process when in dev mode and electron-b…
fdaveine Nov 3, 2020
75d1e6c
Fix a race condition issue where checkForUpdates emitted event before…
fdaveine Nov 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ on:
push:
branches:
- master
- fix-auto-update # FIXME remove

jobs:
release:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [windows-2019, ubuntu-18.04, macos-latest]
os: [macos-latest]
# os: [windows-2019, ubuntu-18.04, macos-latest] FIXME restore

steps:
- name: Check out Git repository
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
.DS_Store
dist/electron/*
dist/electron/dev-app-update.yml
dist/web/*
build/*
!build/icons
!build/entitlements.mac.plist
build/output/*
node_modules/
npm-debug.log
npm-debug.log.*
Expand Down
53 changes: 43 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@

### Installation

Please refer to this page to install client on Windows, Linux (deb), macOS : [https://welcome.papermatter.app/downloads/](https://welcome.papermatter.app/downloads/)
You can download and install client from this page (Windows, Linux, macOS): [https://welcome.papermatter.app/downloads/](https://welcome.papermatter.app/downloads/)

### Logs location

In case you report a bug, it could be useful to join the log files. The easiest way to get them is to display *Advanced* menu by hitting `Alt` key (not needed on macOS) and click on *Open logs folder* item.

If app can't be run, you can also find them by manually opening this folder:

- Linux: ~/.config/paper-matter-import-export/logs/
- macOS: ~/Library/Logs/paper-matter-import-export/
- Windows: %USERPROFILE%\AppData\Roaming\paper-matter-import-export\logs\

## For developers

Expand All @@ -22,9 +32,11 @@ Please refer to this page to install client on Windows, Linux (deb), macOS : [ht

npm run dev

#### Debug app run
#### Debug local run

Useful logs should appears inside the terminal used to run the app.

During dev you can remote debug the app by copying the debugger url which appears in the console at app run.
You can also remote debug the app by copying the debugger url which appears in the console at app run.

# line which appears in console at app run
Debugger listening on ws://127.0.0.1:5858/0b935d7b-0f11-4c23-92f7-221310dfbaa0
Expand All @@ -34,6 +46,26 @@ To attach debugger in Chrome, open this url:

_For more infos see https://simulatedgreg.gitbooks.io/electron-vue/content/en/debugging-production.html_

#### Debug update process

_Run all command from sme Terminal for set ENV VAR to be preserved_

1. Create a test repo with a README.md on Github
1. Update `package.json` > `version` to a very high number (e.g. 100.0.0, make sure it doesn't match an already published release for this repo)
1. Update `package.json` > `build.publish` to use the test repo
1. Comment condition to run `autoUpdater.checkForUpdates()` inside `/src/main/index.js`
1. Set Github token to access test repo: `export GH_TOKEN=XXX` (token need repo scope)
1. Publish app to a Github draft release: `electron-builder -p always`
1. Edit and publish release on Github
1. Restore old value for `package.json` > `version`
1. Copy `dev-app-update.yml` to `dist/electron/dev-app-update.yml` and update values to use test repo
1. (optional) Set ENV VAR to help debug electron-builder process: `export DEBUG=electron-builder`
1. (Linux only) Set APPIMAGE ENV VAR: `export APPIMAGE=true`
1. (Mac only) App notarization is needed to test full update process, you have to set `API_KEY_ID` and `API_KEY_ISSUER_ID` (theses values can be generated/retrieved from https://appstoreconnect.apple.com/access/api)
1. Run app in dev mode `npm run dev` to test update process partially or build app `npm run build` and run it to test full update process

You should see logs related to update process popping in the terminal

### Run tests

#### Unit tests
Expand All @@ -44,17 +76,18 @@ _With [Karma](https://karma-runner.github.io/latest/index.html) test runner, [Mo

### Release and build process on CI

1. Create a draft release on Github
* tag should be on master and named with `version` prefixed with a `v` (eg. `v1.0.0`)
* name should be `version` (eg. `1.0.0`)
2. Update package.json `version` (eg. `1.0.0`) and push
3. :warning: Wait for built app to be uploaded by CI to draft release :warning:
4. Publish and tag release on Github
1. Update package.json `version` (eg. `1.0.0`) and push
1. :warning: Wait for draft release to be created and built app to be attached to it :warning:
1. Complete and publish/tag release on Github

#### Debug app build locally

# Produce simple executable without full installer in /dist.
# Produce simple executable without full installer in /build/output.
npm run build:dir
# You can run unpackaged app by running executable
cd build/output/linux-unpacked/
./paper-matter-import-export
# Useful logs may appears in terminal during app execution

# Credits

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
5 changes: 5 additions & 0 deletions dev-app-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copy this file inside dist/electron to test electron update
# Update the file accordingly to the test repo url, e.g.: https://github.com/repo-owner/repo-name
owner: repo-owner # CHANGEME
repo: repo-name # CHANGEMEN
provider: github
Loading