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 public OTA updates #166

Merged
merged 23 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
90d8aef
(WIP) Fix public OTA
Jun 3, 2024
d39cafb
update dependencies, linting .etc
Jun 4, 2024
ab2a260
chore: Remove mac updater from electron main.js
Jun 4, 2024
6241e1d
chore: Update package version to "0.0.1-ota"
truemiller Jun 5, 2024
a9c3b6f
omit token from macupdater options
truemiller Jun 5, 2024
34a3d98
chore: Update package version to "0.0.1"
truemiller Jun 5, 2024
94bb00b
feat: Update electron-updater options in main.js and publishOptions.js
truemiller Jun 5, 2024
479f87d
chore: Remove unused token from electron-updater options
truemiller Jun 5, 2024
d831baa
chore: Update macUpdater import in electron/main.js
truemiller Jun 5, 2024
669819f
chore: Update publishOptions.js to include GH_TOKEN
truemiller Jun 5, 2024
8c09cdd
chore: Refactor electron/update.js to use updated electron-updater op…
truemiller Jun 5, 2024
3dd615c
Refactor electron/update.js to use updated electron-updater options
truemiller Jun 5, 2024
38ca160
Refactor electron/update.js to use updated electron-updater options
truemiller Jun 5, 2024
e73b566
Refactor electron/update.js to use updated electron-updater options
truemiller Jun 5, 2024
874030c
Refactor electron/update.js to use updated electron-updater options
truemiller Jun 5, 2024
3a72564
chore: Bump package version to "0.1.0-rc34.2"
truemiller Jun 5, 2024
e3afe76
chore: Bump package version to "0.1.0-rc34.3"
truemiller Jun 5, 2024
75202a7
chore: Update import path for githubPublishOptions in build.js
truemiller Jun 5, 2024
cc897b0
chore: Bump package version to "0.1.0-rc34.2"
truemiller Jun 5, 2024
4934a50
chore: Bump package version to "0.1.0-rc34.3"
truemiller Jun 5, 2024
6c97775
Merge remote-tracking branch 'origin/main' into josh/public-ota
truemiller Jun 5, 2024
d779f1b
fix eslint conflicts
truemiller Jun 5, 2024
635f3f1
merge
truemiller Jun 12, 2024
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: 2 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const dotenv = require('dotenv');
const build = require('electron-builder').build;
const { publishOptions } = require('./electron/constants/publishOptions');
const { githubPublishOptions } = require('./electron/constants/config');

dotenv.config();

Expand All @@ -27,7 +27,7 @@ const main = async () => {
arch: ['x64', 'arm64'],
},
],
publish: publishOptions,
publish: githubPublishOptions,
category: 'public.app-category.utilities',
icon: 'electron/assets/icons/splash-robot-head-dock.png',
hardenedRuntime: true,
Expand Down
2 changes: 2 additions & 0 deletions electron/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.next
scripts
6 changes: 3 additions & 3 deletions electron/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"plugins": ["prettier"],
"ignorePatterns": [".next/"],
"plugins": ["prettier", "unused-imports"],
"rules": {
"prettier/prettier": [
"error",
Expand All @@ -11,7 +10,8 @@
"singleQuote": true
}
],
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }]
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"unused-imports/no-unused-imports": "error"
},
"parserOptions": {
"ecmaVersion": "latest",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const publishOptions = {
const githubOptions = {
releaseType: 'draft',
publishAutoUpdate: true,
token: process.env.GH_TOKEN,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oaksprout commented that the user has to manually update it.

provider: 'github',
owner: 'valory-xyz',
repo: 'olas-operate-app',
releaseType: 'draft',
token: process.env.GH_TOKEN,
private: false,
publishAutoUpdate: false,
protocol: 'https',
channel: 'latest',
};

module.exports = { publishOptions };
module.exports = { githubOptions };
16 changes: 4 additions & 12 deletions electron/update.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
const { publishOptions } = require('./constants/publishOptions');
const electronUpdater = require('electron-updater');
const { MacUpdater } = require('electron-updater');
const electronLogger = require('electron-log');
const { githubOptions } = require('./constants/config');

const macUpdater = new electronUpdater.MacUpdater({
...publishOptions,
channels: ['latest', 'beta', 'alpha'], // automatically update to all channels
});
const macUpdater = new MacUpdater(githubOptions);

macUpdater.logger = electronLogger;

macUpdater.setFeedURL({ ...publishOptions });

macUpdater.autoDownload = false;
macUpdater.autoInstallOnAppQuit = true;
electronLogger.transports.file.level = 'info';
macUpdater.logger = electronLogger;

module.exports = { macUpdater };
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"cross-env": "^7.0.3",
"dockerode": "^4.0.2",
"dotenv": "^16.4.5",
"electron-log": "^5.1.4",
"electron-log": "^5.1.5",
"electron-store": "^9.0.0",
"electron-updater": "^6.1.8",
"electron-updater": "^6.3.0-alpha.4",
"ethers": "5.7.2",
"ethers-multicall": "^0.2.3",
"lodash": "^4.17.21",
Expand All @@ -38,6 +38,7 @@
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unused-imports": "^4.0.0",
"hardhat": "==2.17.1",
"net": "^1.0.2",
"prettier": "^3.2.5"
Expand Down
Loading
Loading