Skip to content

Commit

Permalink
ci: arrangements for beta channel
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Jul 31, 2023
1 parent 2e11a0c commit 36efeeb
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 21 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build & release [BETA]

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

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

strategy:
matrix:
os: [macos-11, ubuntu-20.04, windows-latest]

steps:
- name: Exit if not on beta branch
if: contains(env.BRANCH_NAME, 'beta') == false
run: |
echo "Wrong environment ${{env.BRANCH_NAME}}"
exit -1
- name: Check out Git repository
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: npm i

- name: "Build"
run: npm run build

- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "build/*.AppImage,build/*.yml,build/*.deb,build/*.dmg,build/*.blockmap,build/*.zip,build/*.exe"
allowUpdates: true
draft: true
generateReleaseNotes: true
13 changes: 11 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Build & release
name: Build & release [STABLE]

on:
push:
tags:
- "v*"
- 'v[0-9]+.[0-9]+.[0-9]+'

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
release:
Expand All @@ -14,6 +17,12 @@ jobs:
os: [macos-11, ubuntu-20.04, windows-latest]

steps:
- name: Exit if not on master branch
if: contains(env.BRANCH_NAME, 'master') == false
run: |
echo "Wrong environment ${{env.BRANCH_NAME}}"
exit -1
- name: Check out Git repository
uses: actions/checkout@v3

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test-e2e-win.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Test end-to-end [WINDOWS]

on: push
on:
push:
branches:
- master

jobs:
release:
Expand Down
38 changes: 27 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"build:appx": "npm run build -- --win appx",
"rebuild:electron": "rimraf ./dist && npm run postinstall && npm run devtools:install",
"release": "standard-version",
"release:pre": "npm run release -- --prerelease alpha",
"release:beta": "npm run release -- --prerelease beta",
"devtools:install": "node scripts/devtoolsInstaller",
"postinstall": "electron-builder install-app-deps",
"test:e2e": "npm run compile && npm run test:e2e-dry",
Expand Down Expand Up @@ -136,7 +136,7 @@
"moment": "~2.29.4",
"mysql2": "~2.3.2",
"node-firebird": "~1.1.4",
"pg": "~8.7.1",
"pg": "~8.11.1",
"pg-connection-string": "~2.5.0",
"pg-query-stream": "~4.2.3",
"pgsql-ast-parser": "~7.2.1",
Expand Down
15 changes: 12 additions & 3 deletions src/main/ipc-handlers/updates.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import { ipcMain } from 'electron';
import { autoUpdater } from 'electron-updater';
import * as Store from 'electron-store';
const persistentStore = new Store({ name: 'settings', clearInvalidConfig: true });
const isMacOS = process.platform === 'darwin';

const persistentStore = new Store({
name: 'settings',
clearInvalidConfig: true,
migrations: {
'0.7.15': store => {
store.set('allow_prerelease', false);
}
}
});

const isMacOS = process.platform === 'darwin';
let mainWindow: Electron.IpcMainEvent;
autoUpdater.allowPrerelease = persistentStore.get('allow_prerelease', true) as boolean;
autoUpdater.allowPrerelease = persistentStore.get('allow_prerelease', false) as boolean;

export default () => {
ipcMain.on('check-for-updates', event => {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/ModalSettingsUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</button>
</div>
<div class="form-group mt-4">
<label class="form-switch d-inline-block disabled" @click.prevent="toggleAllowPrerelease">
<label class="form-switch d-inline-block" @click.prevent="toggleAllowPrerelease">
<input type="checkbox" :checked="allowPrerelease">
<i class="form-icon" /> {{ t('message.includeBetaUpdates') }}
</label>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/stores/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type ApplicationTheme = 'light' | 'dark';
export const useSettingsStore = defineStore('settings', {
state: () => ({
locale: settingsStore.get('locale', 'en-US') as AvailableLocale,
allowPrerelease: settingsStore.get('allow_prerelease', true) as boolean,
allowPrerelease: settingsStore.get('allow_prerelease', false) as boolean,
explorebarSize: settingsStore.get('explorebar_size', null) as number,
notificationsTimeout: settingsStore.get('notifications_timeout', 5) as number,
showTableSize: settingsStore.get('show_table_size', false) as boolean,
Expand Down

0 comments on commit 36efeeb

Please sign in to comment.