Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2cf64b556f | |||
| 55ac9a4596 | |||
| ec7adaafe3 | |||
| b1c702a033 | |||
| 6e9ef636b6 | |||
| 2cc6ac4667 | |||
| 9f705147b6 | |||
| 3529772cf7 | |||
| b6619e2ea4 |
+37
-18
@@ -1,31 +1,50 @@
|
||||
name: Build & release
|
||||
|
||||
on: push
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
branches:
|
||||
- "**"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
build-and-release:
|
||||
name: Build App
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v1
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Node.js, NPM and Yarn
|
||||
uses: actions/setup-node@v1
|
||||
- name: Checkout assets
|
||||
run: git -c submodule."assets".update=checkout submodule update --init assets
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
node-version: 10
|
||||
run_install: false
|
||||
|
||||
- name: Build/release Electron app
|
||||
uses: samuelmeuli/action-electron-builder@v1
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
# GitHub token, automatically provided to the action
|
||||
# (No need to define this secret in the repo settings)
|
||||
github_token: ${{ secrets.github_token }}
|
||||
node-version: 22
|
||||
cache: "pnpm"
|
||||
|
||||
# If the commit is tagged with a version (e.g. "v1.0.0"),
|
||||
# release the app after building
|
||||
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Build or Publish
|
||||
run: |
|
||||
if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
|
||||
pnpm run publish
|
||||
else
|
||||
pnpm run make
|
||||
fi
|
||||
shell: bash
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
Vendored
-2
@@ -1,9 +1,7 @@
|
||||
{
|
||||
"editor.formatOnSave": true,
|
||||
"files.exclude": {
|
||||
"**/.vite": true,
|
||||
"**/node_modules": true,
|
||||
"**/pnpm-lock.yaml": true,
|
||||
"**/tsconfig.json": false
|
||||
},
|
||||
"editor.detectIndentation": false,
|
||||
|
||||
+1
-1
Submodule assets updated: 3a0d29a0e7...628eb2f825
+20
-13
@@ -9,7 +9,8 @@ import { VitePlugin } from "@electron-forge/plugin-vite";
|
||||
import { PublisherGithub } from "@electron-forge/publisher-github";
|
||||
import type { ForgeConfig } from "@electron-forge/shared-types";
|
||||
import { FuseV1Options, FuseVersion } from "@electron/fuses";
|
||||
import { globSync } from "node:fs";
|
||||
|
||||
// import { globSync } from "node:fs";
|
||||
|
||||
const STRINGS = {
|
||||
author: "Revolt Platforms LTD",
|
||||
@@ -26,21 +27,31 @@ const config: ForgeConfig = {
|
||||
name: STRINGS.name,
|
||||
executableName: STRINGS.execName,
|
||||
icon: `${ASSET_DIR}/icon`,
|
||||
extraResource: [
|
||||
// include all the asset files
|
||||
...globSync(ASSET_DIR + "/**/*"),
|
||||
],
|
||||
// extraResource: [
|
||||
// // include all the asset files
|
||||
// ...globSync(ASSET_DIR + "/**/*"),
|
||||
// ],
|
||||
},
|
||||
rebuildConfig: {},
|
||||
makers: [
|
||||
new MakerAppX({}),
|
||||
new MakerAppX({
|
||||
packageExecutable: `app\\${STRINGS.execName}.exe`,
|
||||
publisher: "CN=B040CC7E-0016-4AF5-957F-F8977A6CFA3B",
|
||||
}),
|
||||
new MakerSquirrel({
|
||||
name: STRINGS.name,
|
||||
authors: STRINGS.author,
|
||||
iconUrl: `${ASSET_DIR}/icon.ico`,
|
||||
// todo: hoist this
|
||||
iconUrl: `https://stoat.chat/app/assets/icon-DUSNE-Pb.ico`,
|
||||
// todo: loadingGif
|
||||
setupIcon: `${ASSET_DIR}/icon.ico`,
|
||||
description: STRINGS.description,
|
||||
exe: `${STRINGS.execName}.exe`,
|
||||
setupExe: `${STRINGS.execName}-setup.exe`,
|
||||
copyright: "Copyright (C) 2025 Revolt Platforms LTD",
|
||||
}),
|
||||
new MakerZIP({}),
|
||||
...[
|
||||
new MakerFlatpak({
|
||||
options: {
|
||||
id: "chat.stoat.stoat-desktop",
|
||||
@@ -99,6 +110,7 @@ const config: ForgeConfig = {
|
||||
"files"
|
||||
> */
|
||||
}),
|
||||
].slice(0, 0), // disable Flatpak build
|
||||
new MakerDeb({
|
||||
options: {
|
||||
productName: STRINGS.name,
|
||||
@@ -125,12 +137,7 @@ const config: ForgeConfig = {
|
||||
target: "preload",
|
||||
},
|
||||
],
|
||||
renderer: [
|
||||
{
|
||||
name: "main_window",
|
||||
config: "vite.renderer.config.ts",
|
||||
},
|
||||
],
|
||||
renderer: [],
|
||||
}),
|
||||
// Fuses are used to enable/disable various Electron functionality
|
||||
// at package time, before code signing the application
|
||||
|
||||
+7
-4
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "stoat-desktop",
|
||||
"productName": "stoat-desktop",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.7",
|
||||
"main": ".vite/build/main.js",
|
||||
"repo": "stoatchat/desktop",
|
||||
"repository": "stoatchat/desktop",
|
||||
"scripts": {
|
||||
"start": "electron-forge start",
|
||||
"package": "electron-forge package",
|
||||
@@ -48,9 +48,12 @@
|
||||
"@electron-forge/maker-appx": "^7.9.0",
|
||||
"@homebridge/dbus-native": "^0.7.2",
|
||||
"auto-launch": "^5.0.6",
|
||||
"bufferutil": "^4.0.9",
|
||||
"discord-rpc": "^4.0.1",
|
||||
"electron-squirrel-startup": "^1.0.1",
|
||||
"electron-store": "^10.1.0",
|
||||
"update-electron-app": "^3.1.1"
|
||||
}
|
||||
"update-electron-app": "^3.1.1",
|
||||
"utf-8-validate": "^6.0.5"
|
||||
},
|
||||
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34"
|
||||
}
|
||||
Generated
+35
-4
@@ -17,9 +17,12 @@ importers:
|
||||
auto-launch:
|
||||
specifier: ^5.0.6
|
||||
version: 5.0.6
|
||||
bufferutil:
|
||||
specifier: ^4.0.9
|
||||
version: 4.0.9
|
||||
discord-rpc:
|
||||
specifier: ^4.0.1
|
||||
version: 4.0.1(encoding@0.1.13)
|
||||
version: 4.0.1(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5)
|
||||
electron-squirrel-startup:
|
||||
specifier: ^1.0.1
|
||||
version: 1.0.1
|
||||
@@ -29,6 +32,9 @@ importers:
|
||||
update-electron-app:
|
||||
specifier: ^3.1.1
|
||||
version: 3.1.1
|
||||
utf-8-validate:
|
||||
specifier: ^6.0.5
|
||||
version: 6.0.5
|
||||
devDependencies:
|
||||
'@electron-forge/cli':
|
||||
specifier: ^7.9.0
|
||||
@@ -1082,6 +1088,10 @@ packages:
|
||||
buffer@5.7.1:
|
||||
resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}
|
||||
|
||||
bufferutil@4.0.9:
|
||||
resolution: {integrity: sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw==}
|
||||
engines: {node: '>=6.14.2'}
|
||||
|
||||
cacache@16.1.3:
|
||||
resolution: {integrity: sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==}
|
||||
engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
|
||||
@@ -2282,6 +2292,10 @@ packages:
|
||||
encoding:
|
||||
optional: true
|
||||
|
||||
node-gyp-build@4.8.4:
|
||||
resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==}
|
||||
hasBin: true
|
||||
|
||||
nopt@6.0.0:
|
||||
resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==}
|
||||
engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
|
||||
@@ -3002,6 +3016,10 @@ packages:
|
||||
resolution: {integrity: sha512-PCKbdWw85JsYMvmCv5GH3kXmM66rCd9m1hBEDutPNv94b/pqCMT4NtcKyeWYvLFiE8b+ha1Jdl8XAaUdPn5QTg==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
utf-8-validate@6.0.5:
|
||||
resolution: {integrity: sha512-EYZR+OpIXp9Y1eG1iueg8KRsY8TuT8VNgnanZ0uA3STqhHQTLwbl+WX76/9X5OY12yQubymBpaBSmMPkSTQcKA==}
|
||||
engines: {node: '>=6.14.2'}
|
||||
|
||||
util-deprecate@1.0.2:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
|
||||
@@ -4411,6 +4429,10 @@ snapshots:
|
||||
base64-js: 1.5.1
|
||||
ieee754: 1.2.1
|
||||
|
||||
bufferutil@4.0.9:
|
||||
dependencies:
|
||||
node-gyp-build: 4.8.4
|
||||
|
||||
cacache@16.1.3:
|
||||
dependencies:
|
||||
'@npmcli/fs': 2.1.2
|
||||
@@ -4662,10 +4684,10 @@ snapshots:
|
||||
dependencies:
|
||||
path-type: 4.0.0
|
||||
|
||||
discord-rpc@4.0.1(encoding@0.1.13):
|
||||
discord-rpc@4.0.1(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5):
|
||||
dependencies:
|
||||
node-fetch: 2.7.0(encoding@0.1.13)
|
||||
ws: 7.5.10
|
||||
ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@6.0.5)
|
||||
optionalDependencies:
|
||||
register-scheme: https://codeload.github.com/devsnek/node-register-scheme/tar.gz/e7cc9a63a1f512565da44cb57316d9fb10750e17
|
||||
transitivePeerDependencies:
|
||||
@@ -5861,6 +5883,8 @@ snapshots:
|
||||
optionalDependencies:
|
||||
encoding: 0.1.13
|
||||
|
||||
node-gyp-build@4.8.4: {}
|
||||
|
||||
nopt@6.0.0:
|
||||
dependencies:
|
||||
abbrev: 1.1.1
|
||||
@@ -6644,6 +6668,10 @@ snapshots:
|
||||
execa: 1.0.0
|
||||
mem: 4.3.0
|
||||
|
||||
utf-8-validate@6.0.5:
|
||||
dependencies:
|
||||
node-gyp-build: 4.8.4
|
||||
|
||||
util-deprecate@1.0.2: {}
|
||||
|
||||
validate-npm-package-license@3.0.4:
|
||||
@@ -6746,7 +6774,10 @@ snapshots:
|
||||
|
||||
wrappy@1.0.2: {}
|
||||
|
||||
ws@7.5.10: {}
|
||||
ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@6.0.5):
|
||||
optionalDependencies:
|
||||
bufferutil: 4.0.9
|
||||
utf-8-validate: 6.0.5
|
||||
|
||||
xml2js@0.6.2:
|
||||
dependencies:
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
nodeLinker: hoisted
|
||||
|
||||
onlyBuiltDependencies:
|
||||
- electron
|
||||
- electron-winstaller
|
||||
- esbuild
|
||||
- register-scheme
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ const acquiredLock = app.requestSingleInstanceLock();
|
||||
|
||||
if (acquiredLock) {
|
||||
// start auto update logic
|
||||
// todo: updateElectronApp();
|
||||
updateElectronApp();
|
||||
|
||||
// create and configure the app when electron is ready
|
||||
app.on("ready", () => {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import dbus from "@homebridge/dbus-native";
|
||||
import { resolve } from "node:path";
|
||||
|
||||
import { NativeImage, app, nativeImage } from "electron";
|
||||
|
||||
@@ -19,8 +18,10 @@ export async function setBadgeCount(count: number) {
|
||||
}
|
||||
|
||||
if (!nativeIcons[count])
|
||||
nativeIcons[count] = nativeImage.createFromPath(
|
||||
resolve(process.resourcesPath, `${Math.min(count, 10)}.ico`),
|
||||
nativeIcons[count] = nativeImage.createFromDataURL(
|
||||
await import(
|
||||
`../../assets/desktop/badges/${Math.min(count, 10)}.ico?asset`
|
||||
),
|
||||
);
|
||||
|
||||
mainWindow.setOverlayIcon(
|
||||
|
||||
+2
-5
@@ -1,7 +1,6 @@
|
||||
import { resolve } from "node:path";
|
||||
|
||||
import { Menu, Tray, nativeImage } from "electron";
|
||||
|
||||
import trayIconAsset from "../../assets/desktop/icon.png?asset";
|
||||
import { version } from "../../package.json";
|
||||
|
||||
import { mainWindow, quitApp } from "./window";
|
||||
@@ -10,9 +9,7 @@ import { mainWindow, quitApp } from "./window";
|
||||
let tray: Tray = null;
|
||||
|
||||
// load the tray icon
|
||||
const trayIcon = nativeImage.createFromPath(
|
||||
resolve(process.resourcesPath, "icon.png"),
|
||||
);
|
||||
const trayIcon = nativeImage.createFromDataURL(trayIconAsset);
|
||||
|
||||
// trayIcon.setTemplateImage(true);
|
||||
|
||||
|
||||
+8
-11
@@ -1,4 +1,4 @@
|
||||
import { join, resolve } from "node:path";
|
||||
import { join } from "node:path";
|
||||
|
||||
import {
|
||||
BrowserWindow,
|
||||
@@ -9,7 +9,8 @@ import {
|
||||
nativeImage,
|
||||
} from "electron";
|
||||
|
||||
import { setBadgeCount } from "./badges";
|
||||
import windowIconAsset from "../../assets/desktop/icon.png?asset";
|
||||
|
||||
import { config } from "./config";
|
||||
import { updateTrayMenu } from "./tray";
|
||||
|
||||
@@ -20,18 +21,14 @@ export let mainWindow: BrowserWindow;
|
||||
export const BUILD_URL = new URL(
|
||||
app.commandLine.hasSwitch("force-server")
|
||||
? app.commandLine.getSwitchValue("force-server")
|
||||
: (MAIN_WINDOW_VITE_DEV_SERVER_URL ?? "https://beta.revolt.chat"),
|
||||
: /*MAIN_WINDOW_VITE_DEV_SERVER_URL ??*/ "https://beta.revolt.chat",
|
||||
);
|
||||
|
||||
// internal window state
|
||||
let shouldQuit = false;
|
||||
|
||||
// load the window icon
|
||||
const windowIcon = nativeImage.createFromPath(
|
||||
resolve(process.resourcesPath, "icon.png"),
|
||||
);
|
||||
|
||||
console.info(resolve(process.resourcesPath, "icon.png"));
|
||||
const windowIcon = nativeImage.createFromDataURL(windowIconAsset);
|
||||
|
||||
// windowIcon.setTemplateImage(true);
|
||||
|
||||
@@ -43,7 +40,7 @@ export function createMainWindow() {
|
||||
mainWindow = new BrowserWindow({
|
||||
minWidth: 300,
|
||||
minHeight: 300,
|
||||
width: 800,
|
||||
width: 1100,
|
||||
height: 600,
|
||||
backgroundColor: "#191919",
|
||||
frame: !config.customFrame,
|
||||
@@ -156,8 +153,8 @@ export function createMainWindow() {
|
||||
|
||||
// mainWindow.webContents.openDevTools();
|
||||
|
||||
let i = 0;
|
||||
setInterval(() => setBadgeCount((++i % 30) + 1), 1000);
|
||||
// let i = 0;
|
||||
// setInterval(() => setBadgeCount((++i % 30) + 1), 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-1
@@ -10,6 +10,7 @@
|
||||
"baseUrl": ".",
|
||||
"outDir": "dist",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true
|
||||
"resolveJsonModule": true,
|
||||
"types": ["electron-vite/node"]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user