Update linux & windows builds
51
.forgejo/workflows/Linux.yaml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
name: Linux Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
|
||||
- name: Install deps
|
||||
run: npm ci
|
||||
|
||||
- name: Sync capacitor
|
||||
run: npx cap sync
|
||||
|
||||
- name: Generate assets
|
||||
run: npx capacitor-assets generate --pwa
|
||||
|
||||
- name: Update web app
|
||||
run: npx cap copy
|
||||
|
||||
- name: Update electron app
|
||||
run: npx cap copy electron
|
||||
|
||||
- name: Convert icon
|
||||
run: magick -background none -density 300 -resize 256x256 ./assets/icon.svg ./icons/icon.png
|
||||
|
||||
- name: Copy icon
|
||||
run: cp ./icons/icon.png ./electron/assets/icon.png
|
||||
|
||||
- name: Build
|
||||
run: mkdir -p build && cd build && npx electron-packager ../electron miarven --platform=linux --arch=x64 --icon=../icons/icon.png --overwrite --asar
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Windows
|
||||
path: ./build/miarven-linux-x64/
|
||||
51
.forgejo/workflows/Windows.yaml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
name: Linux Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
|
||||
- name: Install deps
|
||||
run: npm ci
|
||||
|
||||
- name: Sync capacitor
|
||||
run: npx cap sync
|
||||
|
||||
- name: Generate assets
|
||||
run: npx capacitor-assets generate --pwa
|
||||
|
||||
- name: Update web app
|
||||
run: npx cap copy
|
||||
|
||||
- name: Update electron app
|
||||
run: npx cap copy electron
|
||||
|
||||
- name: Convert icon
|
||||
run: magick -background none -density 300 -define icon:auto-resize=256,128,64,48,32,16 ./assets/icon.svg ./icons/icon.ico
|
||||
|
||||
- name: Copy icon
|
||||
run: cp ./icons/icon.ico ./electron/assets/icon.ico
|
||||
|
||||
- name: Build
|
||||
run: mkdir -p build && cd build && npx electron-packager ../electron miarven --platform=win32 --arch=x64 --icon=../icons/icon.png --overwrite --asar
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Windows
|
||||
path: ./build/miarven-win32-x64/
|
||||
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 8 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 619 B After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 317 B After Width: | Height: | Size: 277 B |
|
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 350 B |
|
Before Width: | Height: | Size: 733 B After Width: | Height: | Size: 3 KiB |
|
Before Width: | Height: | Size: 785 B After Width: | Height: | Size: 697 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 16 KiB |
|
|
@ -1,2 +1,3 @@
|
|||
npx capacitor-assets generate --android
|
||||
cd android
|
||||
./gradlew assembleRelease
|
||||
|
|
@ -1,3 +1,7 @@
|
|||
npx cap copy electron
|
||||
npx capacitor-assets generate --pwa
|
||||
magick -background none -density 300 -resize 256x256 ./assets/icon.svg ./icons/icon.png
|
||||
cp ./icons/icon.png ./electron/assets/icon.png
|
||||
mkdir build
|
||||
cd build
|
||||
npx electron-packager ../electron miarven --platform=linux --arch=x64
|
||||
npx electron-packager ../electron miarven --platform=linux --arch=x64 --icon=../icons/icon.png --overwrite --asar
|
||||
|
|
@ -1,3 +1,8 @@
|
|||
npx cap copy electron
|
||||
npx capacitor-assets generate --pwa
|
||||
magick -background none -density 300 -define icon:auto-resize=256,128,64,48,32,16 ./assets/icon.svg ./icons/icon.ico
|
||||
cp ./icons/icon.ico ./electron/assets/icon.ico
|
||||
mkdir build
|
||||
cd build
|
||||
npx electron-packager ../electron miarven --platform=win32 --arch=x64
|
||||
npx electron-packager ../electron miarven --platform=win32 --arch=x64 --icon=../icons/icon.ico --overwrite --asar
|
||||
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 121 KiB |
BIN
electron/assets/icon.ico
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
electron/assets/icon.png
Normal file
|
After Width: | Height: | Size: 301 KiB |
|
Before Width: | Height: | Size: 159 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
|
@ -7,7 +7,8 @@ import {
|
|||
import chokidar from 'chokidar';
|
||||
import type { MenuItemConstructorOptions } from 'electron';
|
||||
import { app, BrowserWindow, Menu, MenuItem, nativeImage, Tray, session } from 'electron';
|
||||
import electronIsDev from 'electron-is-dev';
|
||||
//import electronIsDev from 'electron-is-dev';
|
||||
var electronIsDev = false;
|
||||
import electronServe from 'electron-serve';
|
||||
import windowStateKeeper from 'electron-window-state';
|
||||
import { join } from 'path';
|
||||
|
|
@ -99,8 +100,14 @@ export class ElectronCapacitorApp {
|
|||
|
||||
async init(): Promise<void> {
|
||||
const icon = nativeImage.createFromPath(
|
||||
join(app.getAppPath(), 'assets', process.platform === 'win32' ? 'appIcon.ico' : 'appIcon.png')
|
||||
join(app.getAppPath(), 'assets', process.platform === 'win32' ? 'icon.ico' : 'icon.png')
|
||||
);
|
||||
|
||||
const appName = "olcxja.miarven"
|
||||
app.setName(appName);
|
||||
|
||||
app.setAppUserModelId(appName);
|
||||
|
||||
this.mainWindowState = windowStateKeeper({
|
||||
defaultWidth: 1000,
|
||||
defaultHeight: 800,
|
||||
|
|
@ -114,6 +121,7 @@ export class ElectronCapacitorApp {
|
|||
y: this.mainWindowState.y,
|
||||
width: this.mainWindowState.width,
|
||||
height: this.mainWindowState.height,
|
||||
autoHideMenuBar: true,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
contextIsolation: true,
|
||||
|
|
@ -122,6 +130,7 @@ export class ElectronCapacitorApp {
|
|||
preload: preloadPath,
|
||||
},
|
||||
});
|
||||
|
||||
this.mainWindowState.manage(this.MainWindow);
|
||||
|
||||
if (this.CapacitorFileConfig.backgroundColor) {
|
||||
|
|
@ -163,31 +172,18 @@ export class ElectronCapacitorApp {
|
|||
}
|
||||
|
||||
// Setup the main manu bar at the top of our window.
|
||||
Menu.setApplicationMenu(Menu.buildFromTemplate(this.AppMenuBarMenuTemplate));
|
||||
//Menu.setApplicationMenu(Menu.buildFromTemplate(this.AppMenuBarMenuTemplate));
|
||||
Menu.setApplicationMenu(null);
|
||||
|
||||
// If the splashscreen is enabled, show it first while the main window loads then switch it out for the main window, or just load the main window from the start.
|
||||
if (this.CapacitorFileConfig.electron?.splashScreenEnabled) {
|
||||
this.SplashScreen = new CapacitorSplashScreen({
|
||||
imageFilePath: join(
|
||||
app.getAppPath(),
|
||||
'assets',
|
||||
this.CapacitorFileConfig.electron?.splashScreenImageName ?? 'splash.png'
|
||||
),
|
||||
windowWidth: 400,
|
||||
windowHeight: 400,
|
||||
});
|
||||
this.SplashScreen.init(this.loadMainWindow, this);
|
||||
} else {
|
||||
this.loadMainWindow(this);
|
||||
}
|
||||
|
||||
this.loadMainWindow(this);
|
||||
|
||||
|
||||
// Security
|
||||
this.MainWindow.webContents.setWindowOpenHandler((details) => {
|
||||
if (!details.url.includes(this.customScheme)) {
|
||||
return { action: 'deny' };
|
||||
} else {
|
||||
|
||||
return { action: 'allow' };
|
||||
}
|
||||
|
||||
});
|
||||
this.MainWindow.webContents.on('will-navigate', (event, _newURL) => {
|
||||
if (!this.MainWindow.webContents.getURL().includes(this.customScheme)) {
|
||||
|
|
@ -207,12 +203,14 @@ export class ElectronCapacitorApp {
|
|||
this.MainWindow.show();
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (electronIsDev) {
|
||||
this.MainWindow.webContents.openDevTools();
|
||||
}
|
||||
|
||||
CapElectronEventEmitter.emit('CAPELECTRON_DeeplinkListenerInitialized', '');
|
||||
}, 400);
|
||||
});
|
||||
|
||||
this.MainWindow.setMenu(null);
|
||||
this.MainWindow.setAutoHideMenuBar(true);
|
||||
this.MainWindow.removeMenu();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
BIN
icons/icon.ico
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
icons/icon.png
Normal file
|
After Width: | Height: | Size: 301 KiB |
|
|
@ -1,9 +1,7 @@
|
|||
#update plugins
|
||||
npx cap sync
|
||||
#update assets
|
||||
#npx capacitor-assets generate
|
||||
#for some reason icon is broken without this
|
||||
npx capacitor-assets generate --pwa
|
||||
npx capacitor-assets generate --android
|
||||
npx capacitor-assets generate
|
||||
#update webroot
|
||||
npx cap copy
|
||||
npx cap copy
|
||||
npx cap copy electron
|
||||