mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 20:16:00 +00:00
builder - updater channel
This commit is contained in:
6
.github/workflows/build-app-pro-beta.yaml
vendored
6
.github/workflows/build-app-pro-beta.yaml
vendored
@@ -60,6 +60,10 @@ jobs:
|
|||||||
cd ..
|
cd ..
|
||||||
cd dbgate-merged
|
cd dbgate-merged
|
||||||
node adjustPackageJsonPremium
|
node adjustPackageJsonPremium
|
||||||
|
run: |
|
||||||
|
cd ..
|
||||||
|
cd dbgate-merged
|
||||||
|
node setUpdaterChannel premium-beta
|
||||||
- name: yarn set timeout
|
- name: yarn set timeout
|
||||||
run: |
|
run: |
|
||||||
cd ..
|
cd ..
|
||||||
@@ -128,6 +132,8 @@ jobs:
|
|||||||
mv ../dbgate-merged/app/dist/*.snap artifacts/ || true
|
mv ../dbgate-merged/app/dist/*.snap artifacts/ || true
|
||||||
mv ../dbgate-merged/app/dist/*.dmg artifacts/ || true
|
mv ../dbgate-merged/app/dist/*.dmg artifacts/ || true
|
||||||
|
|
||||||
|
mv ../dbgate-merged/app/dist/*.yml artifacts/ || true
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ const path = require('path');
|
|||||||
const url = require('url');
|
const url = require('url');
|
||||||
const mainMenuDefinition = require('./mainMenuDefinition');
|
const mainMenuDefinition = require('./mainMenuDefinition');
|
||||||
const { isProApp } = require('./proTools');
|
const { isProApp } = require('./proTools');
|
||||||
|
const updaterChannel = require('./updaterChannel');
|
||||||
let disableAutoUpgrade = false;
|
let disableAutoUpgrade = false;
|
||||||
|
|
||||||
// require('@electron/remote/main').initialize();
|
// require('@electron/remote/main').initialize();
|
||||||
@@ -74,8 +75,8 @@ let runCommandOnLoad = null;
|
|||||||
|
|
||||||
log.transports.file.level = 'debug';
|
log.transports.file.level = 'debug';
|
||||||
autoUpdater.logger = log;
|
autoUpdater.logger = log;
|
||||||
if (isProApp()) {
|
if (updaterChannel) {
|
||||||
autoUpdater.channel = 'premium';
|
autoUpdater.channel = updaterChannel;
|
||||||
}
|
}
|
||||||
// TODO - create settings for this
|
// TODO - create settings for this
|
||||||
// appUpdater.channel = 'beta';
|
// appUpdater.channel = 'beta';
|
||||||
|
|||||||
1
app/src/updaterChannel.js
Normal file
1
app/src/updaterChannel.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = null;
|
||||||
14
setUpdaterChannel.js
Normal file
14
setUpdaterChannel.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
function adjustAppFile(file) {
|
||||||
|
const channel = process.argv[2];
|
||||||
|
const json = JSON.parse(fs.readFileSync(file, { encoding: 'utf-8' }));
|
||||||
|
json.build.mac.publish[0].channel = channel;
|
||||||
|
json.build.linux.publish[0].channel = channel;
|
||||||
|
json.build.win.publish[0].channel = channel;
|
||||||
|
fs.writeFileSync(file, JSON.stringify(json, null, 2), 'utf-8');
|
||||||
|
}
|
||||||
|
|
||||||
|
adjustAppFile('app/package.json');
|
||||||
|
|
||||||
|
fs.writeFileSync('app/src/updaterChannel.js', `module.exports = '${process.argv[2]}';`, 'utf-8');
|
||||||
Reference in New Issue
Block a user