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

feat: staging setup - update build.js configuration #152

Merged
merged 6 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FORK_URL=
NODE_ENV=
DEV_RPC=
STAKING_TEST_KEYS_PATH=
DEV_RPC=
IS_STAGING=
8 changes: 4 additions & 4 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 { publishOptions } = require('./electron/constants/publishOptions');

dotenv.config();

Expand All @@ -24,7 +24,7 @@ const main = async () => {
target: [
{
target: 'default',
arch: ['x64','arm64'],
arch: ['x64', 'arm64'],
},
],
publish: publishOptions,
Expand All @@ -35,11 +35,11 @@ const main = async () => {
entitlements: 'electron/entitlements.mac.plist',
entitlementsInherit: 'electron/entitlements.mac.plist',
notarize: {
teamId: process.env.APPLETEAMID
teamId: process.env.APPLETEAMID,
},
},
},
});
};

main().then((response) => { console.log('Build & Notarize complete'); }).catch((e) => console.error(e));
main().then((response) => { console.log('Build & Notarize complete'); }).catch((e) => console.error(e));
3 changes: 2 additions & 1 deletion electron/constants/publishOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ const publishOptions = {
provider: 'github',
owner: 'valory-xyz',
repo: 'olas-operate-app',
releaseType: 'release',
token: process.env.GH_TOKEN,
private: false,
publishAutoUpdate: true,
releaseType: process.env.IS_STAGING === 'true' ? 'prerelease' : 'release',
channel: process.env.IS_STAGING === 'true' ? 'alpha' : 'latest',
};

module.exports = { publishOptions };
4 changes: 2 additions & 2 deletions electron/loading/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
const { ipcRenderer } = require("electron");
ipcRenderer.on("response", (event, arg) => {
if (typeof arg === "string") {
if (arg.includes(/Installing/)) {
if (arg.includes("Installing")) {
document.getElementById("text").innerHTML =
`Installing app dependencies...
<br />
This might take a while`;
} else if (arg.includes(/Development mode/)) {
} else if (arg.includes("Development")) {
document.getElementById("text").innerHTML = arg;
}
}
Expand Down
9 changes: 2 additions & 7 deletions electron/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@ const { publishOptions } = require('./constants/publishOptions');
const electronUpdater = require('electron-updater');
const electronLogger = require('electron-log');

const macUpdater = new electronUpdater.MacUpdater({
...publishOptions,
private: false,
});
const macUpdater = new electronUpdater.MacUpdater({ ...publishOptions });

macUpdater.logger = electronLogger;

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

macUpdater.autoDownload = true;
macUpdater.autoInstallOnAppQuit = true;
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"author": "Valory AG",
"main": "electron/main.js",
"name": "olas-operate-app",
"productName": "Pearl",
"private": true,
"version": "0.1.0-rc26",
"dependencies": {
"@ant-design/cssinjs": "^1.18.4",
"@ant-design/icons": "^5.3.0",
Expand Down Expand Up @@ -36,10 +41,6 @@
"net": "^1.0.2",
"prettier": "^3.2.5"
},
"main": "electron/main.js",
"name": "olas-operate-app",
"productName": "Pearl",
"private": true,
"scripts": {
"build:frontend": "cd frontend && yarn build && rm -rf ../electron/.next && cp -r .next ../electron/.next && rm -rf ../electron/public && cp -r public ../electron/public",
"dev:backend": "poetry run python operate/cli.py",
Expand All @@ -53,6 +54,5 @@
"test:frontend": "cd frontend && yarn test",
"start": "electron .",
"build": "rm -rf dist/ && electron-builder build"
},
"version": "0.1.0-rc26"
}
}
Loading