Skip to content

Commit

Permalink
chore: new release strategy (wexond#396)
Browse files Browse the repository at this point in the history
* chore: add nightly icons

* chore: build script for nightly

* fix: improve compile script

* chore: ci-build script
  • Loading branch information
sentialx authored Feb 20, 2020
1 parent 5fa8aa8 commit 14f9787
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ dist
.DS_Store
.fusebox
filters
package-lock.json
package-lock.json
temp-electron-builder.json
temp-package.json
2 changes: 1 addition & 1 deletion electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"asar": true,
"directories": {
"output": "dist",
"buildResources": "static/app-icons"
"buildResources": "static/icons"
},
"files": ["build/**/*", "package.json", "static/**/*"],
"publish": "github",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wexond",
"version": "4.0.0-beta.3",
"version": "4.0.0-nightly.21",
"description": "Extensible, fast and innovative web browser with material UI.",
"keywords": [
"web-browser",
Expand All @@ -22,6 +22,7 @@
},
"scripts": {
"dev": "cross-env START=1 npm run watch",
"ci-build": "node scripts/ci-build.js && npm run build",
"build": "npm run extensions && concurrently \"webpack --config webpack.config.renderer.js\" \"webpack\" \"webpack --config webpack.config.web.js\"",
"start": "cross-env NODE_ENV='dev' electron .",
"watch": "npm run extensions && concurrently \"cross-env ENV='dev' webpack-dev-server --config webpack.config.renderer.js\" \" cross-env ENV='dev' webpack\" \"cross-env ENV='dev' webpack-dev-server --config webpack.config.web.js\"",
Expand Down
54 changes: 54 additions & 0 deletions scripts/ci-build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const package = require('../package.json');
const electronBuilder = require('../electron-builder.json');
const { promises } = require('fs');
const { resolve } = require('path');

const isNightly = package.version.indexOf('nightly') !== -1;

(async () => {
try {
await promises.unlink(resolve(__dirname, '../temp-package.json'));
} catch (e) {}

try {
if (isNightly) {
await promises.copyFile(
resolve(__dirname, '../package.json'),
resolve(__dirname, '../temp-package.json'),
);
await promises.copyFile(
resolve(__dirname, '../electron-builder.json'),
resolve(__dirname, '../temp-electron-builder.json'),
);
const newPkg = {
...package,
name: 'wexond-nightly',
repository: {
type: 'git',
url: 'git+https://github.com/wexond/desktop-nightly.git',
},
};
await promises.writeFile(
resolve(__dirname, '../package.json'),
JSON.stringify(newPkg),
);

const newEBConfig = {
...electronBuilder,
appId: 'org.wexond.wexond-nightly',
productName: 'Wexond Nightly',
directories: {
output: 'dist',
buildResources: 'static/nightly-icons',
},
};

await promises.writeFile(
resolve(__dirname, '../electron-builder.json'),
JSON.stringify(newEBConfig),
);
}
} catch (e) {
console.error(e);
}
})();
2 changes: 1 addition & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { platform } from 'os';
import { WindowsManager } from './windows-manager';

app.allowRendererProcessReuse = true;
app.name = 'Wexond';
app.name = app.name === 'wexond-nightly' ? 'Wexond Nightly' : 'Wexond';

(process.env as any)['ELECTRON_DISABLE_SECURITY_WARNINGS'] = true;
app.commandLine.appendSwitch('--enable-transparent-visuals');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
Binary file added static/nightly-icons/icon.icns
Binary file not shown.
Binary file added static/nightly-icons/icon.ico
Binary file not shown.
Binary file added static/nightly-icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 14f9787

Please sign in to comment.