Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2cf64b556f | |||
| 55ac9a4596 | |||
| ec7adaafe3 | |||
| b1c702a033 | |||
| 6e9ef636b6 | |||
| 2cc6ac4667 |
@@ -0,0 +1,50 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-release:
|
||||||
|
name: Build App
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Checkout assets
|
||||||
|
run: git -c submodule."assets".update=checkout submodule update --init assets
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
run_install: false
|
||||||
|
|
||||||
|
- name: Install Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: "pnpm"
|
||||||
|
|
||||||
|
- 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
-1
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"files.exclude": {
|
"files.exclude": {
|
||||||
"**/.vite": true,
|
|
||||||
"**/node_modules": true,
|
"**/node_modules": true,
|
||||||
"**/tsconfig.json": false
|
"**/tsconfig.json": false
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
Submodule assets updated: f60a38e137...628eb2f825
+68
-66
@@ -9,7 +9,8 @@ import { VitePlugin } from "@electron-forge/plugin-vite";
|
|||||||
import { PublisherGithub } from "@electron-forge/publisher-github";
|
import { PublisherGithub } from "@electron-forge/publisher-github";
|
||||||
import type { ForgeConfig } from "@electron-forge/shared-types";
|
import type { ForgeConfig } from "@electron-forge/shared-types";
|
||||||
import { FuseV1Options, FuseVersion } from "@electron/fuses";
|
import { FuseV1Options, FuseVersion } from "@electron/fuses";
|
||||||
import { globSync } from "node:fs";
|
|
||||||
|
// import { globSync } from "node:fs";
|
||||||
|
|
||||||
const STRINGS = {
|
const STRINGS = {
|
||||||
author: "Revolt Platforms LTD",
|
author: "Revolt Platforms LTD",
|
||||||
@@ -26,10 +27,10 @@ const config: ForgeConfig = {
|
|||||||
name: STRINGS.name,
|
name: STRINGS.name,
|
||||||
executableName: STRINGS.execName,
|
executableName: STRINGS.execName,
|
||||||
icon: `${ASSET_DIR}/icon`,
|
icon: `${ASSET_DIR}/icon`,
|
||||||
extraResource: [
|
// extraResource: [
|
||||||
// include all the asset files
|
// // include all the asset files
|
||||||
...globSync(ASSET_DIR + "/**/*"),
|
// ...globSync(ASSET_DIR + "/**/*"),
|
||||||
],
|
// ],
|
||||||
},
|
},
|
||||||
rebuildConfig: {},
|
rebuildConfig: {},
|
||||||
makers: [
|
makers: [
|
||||||
@@ -42,68 +43,74 @@ const config: ForgeConfig = {
|
|||||||
authors: STRINGS.author,
|
authors: STRINGS.author,
|
||||||
// todo: hoist this
|
// todo: hoist this
|
||||||
iconUrl: `https://stoat.chat/app/assets/icon-DUSNE-Pb.ico`,
|
iconUrl: `https://stoat.chat/app/assets/icon-DUSNE-Pb.ico`,
|
||||||
|
// todo: loadingGif
|
||||||
setupIcon: `${ASSET_DIR}/icon.ico`,
|
setupIcon: `${ASSET_DIR}/icon.ico`,
|
||||||
description: STRINGS.description,
|
description: STRINGS.description,
|
||||||
|
exe: `${STRINGS.execName}.exe`,
|
||||||
|
setupExe: `${STRINGS.execName}-setup.exe`,
|
||||||
|
copyright: "Copyright (C) 2025 Revolt Platforms LTD",
|
||||||
}),
|
}),
|
||||||
new MakerZIP({}),
|
new MakerZIP({}),
|
||||||
new MakerFlatpak({
|
...[
|
||||||
options: {
|
new MakerFlatpak({
|
||||||
id: "chat.stoat.stoat-desktop",
|
options: {
|
||||||
description: STRINGS.description,
|
id: "chat.stoat.stoat-desktop",
|
||||||
productName: STRINGS.name,
|
description: STRINGS.description,
|
||||||
productDescription: STRINGS.description,
|
productName: STRINGS.name,
|
||||||
runtimeVersion: "21.08",
|
productDescription: STRINGS.description,
|
||||||
icon: `${ASSET_DIR}/icon.png`,
|
runtimeVersion: "21.08",
|
||||||
categories: ["Network"],
|
icon: `${ASSET_DIR}/icon.png`,
|
||||||
modules: [
|
categories: ["Network"],
|
||||||
// use the latest zypak -- Electron sandboxing for Flatpak
|
modules: [
|
||||||
{
|
// use the latest zypak -- Electron sandboxing for Flatpak
|
||||||
name: "zypak",
|
{
|
||||||
sources: [
|
name: "zypak",
|
||||||
{
|
sources: [
|
||||||
type: "git",
|
{
|
||||||
url: "https://github.com/refi64/zypak",
|
type: "git",
|
||||||
tag: "v2025.09",
|
url: "https://github.com/refi64/zypak",
|
||||||
},
|
tag: "v2025.09",
|
||||||
],
|
},
|
||||||
},
|
],
|
||||||
],
|
},
|
||||||
finishArgs: [
|
],
|
||||||
// default arguments found by running
|
finishArgs: [
|
||||||
// DEBUG=electron-installer-flatpak* pnpm make
|
// default arguments found by running
|
||||||
"--socket=x11",
|
// DEBUG=electron-installer-flatpak* pnpm make
|
||||||
"--share=ipc",
|
"--socket=x11",
|
||||||
"--device=dri",
|
"--share=ipc",
|
||||||
"--socket=pulseaudio",
|
"--device=dri",
|
||||||
"--filesystem=home",
|
"--socket=pulseaudio",
|
||||||
"--env=TMPDIR=/var/tmp",
|
"--filesystem=home",
|
||||||
"--share=network",
|
"--env=TMPDIR=/var/tmp",
|
||||||
"--talk-name=org.freedesktop.Notifications",
|
"--share=network",
|
||||||
// add Unity talk name for badges
|
"--talk-name=org.freedesktop.Notifications",
|
||||||
"--talk-name=com.canonical.Unity",
|
// add Unity talk name for badges
|
||||||
],
|
"--talk-name=com.canonical.Unity",
|
||||||
// files: [
|
],
|
||||||
// // is this necessary?
|
// files: [
|
||||||
// // https://stackoverflow.com/q/79745700
|
// // is this necessary?
|
||||||
// ...[16, 32, 64, 128, 256, 512].map(
|
// // https://stackoverflow.com/q/79745700
|
||||||
// (size) =>
|
// ...[16, 32, 64, 128, 256, 512].map(
|
||||||
// [
|
// (size) =>
|
||||||
// `assets/desktop/hicolor/${size}x${size}.png`,
|
// [
|
||||||
// `/app/share/icons/hicolor/${size}x${size}/apps/chat.stoat.stoat-desktop.png`,
|
// `assets/desktop/hicolor/${size}x${size}.png`,
|
||||||
// ] as [string, string],
|
// `/app/share/icons/hicolor/${size}x${size}/apps/chat.stoat.stoat-desktop.png`,
|
||||||
// ),
|
// ] as [string, string],
|
||||||
// [
|
// ),
|
||||||
// `assets/desktop/icon.svg`,
|
// [
|
||||||
// `/app/share/icons/hicolor/scalable/apps/chat.stoat.stoat-desktop.svg`,
|
// `assets/desktop/icon.svg`,
|
||||||
// ] as [string, string],
|
// `/app/share/icons/hicolor/scalable/apps/chat.stoat.stoat-desktop.svg`,
|
||||||
// ],
|
// ] as [string, string],
|
||||||
files: [],
|
// ],
|
||||||
} as MakerFlatpakOptionsConfig,
|
files: [],
|
||||||
/* as Omit<
|
} as MakerFlatpakOptionsConfig,
|
||||||
|
/* as Omit<
|
||||||
MakerFlatpakOptionsConfig,
|
MakerFlatpakOptionsConfig,
|
||||||
"files"
|
"files"
|
||||||
> */
|
> */
|
||||||
}),
|
}),
|
||||||
|
].slice(0, 0), // disable Flatpak build
|
||||||
new MakerDeb({
|
new MakerDeb({
|
||||||
options: {
|
options: {
|
||||||
productName: STRINGS.name,
|
productName: STRINGS.name,
|
||||||
@@ -130,12 +137,7 @@ const config: ForgeConfig = {
|
|||||||
target: "preload",
|
target: "preload",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
renderer: [
|
renderer: [],
|
||||||
{
|
|
||||||
name: "main_window",
|
|
||||||
config: "vite.renderer.config.ts",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}),
|
}),
|
||||||
// Fuses are used to enable/disable various Electron functionality
|
// Fuses are used to enable/disable various Electron functionality
|
||||||
// at package time, before code signing the application
|
// at package time, before code signing the application
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "stoat-desktop",
|
"name": "stoat-desktop",
|
||||||
"productName": "stoat-desktop",
|
"productName": "stoat-desktop",
|
||||||
"version": "1.1.0",
|
"version": "1.1.7",
|
||||||
"main": ".vite/build/main.js",
|
"main": ".vite/build/main.js",
|
||||||
"repository": "stoatchat/desktop",
|
"repository": "stoatchat/desktop",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import dbus from "@homebridge/dbus-native";
|
import dbus from "@homebridge/dbus-native";
|
||||||
import { resolve } from "node:path";
|
|
||||||
|
|
||||||
import { NativeImage, app, nativeImage } from "electron";
|
import { NativeImage, app, nativeImage } from "electron";
|
||||||
|
|
||||||
@@ -19,8 +18,10 @@ export async function setBadgeCount(count: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!nativeIcons[count])
|
if (!nativeIcons[count])
|
||||||
nativeIcons[count] = nativeImage.createFromPath(
|
nativeIcons[count] = nativeImage.createFromDataURL(
|
||||||
resolve(process.resourcesPath, `${Math.min(count, 10)}.ico`),
|
await import(
|
||||||
|
`../../assets/desktop/badges/${Math.min(count, 10)}.ico?asset`
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
mainWindow.setOverlayIcon(
|
mainWindow.setOverlayIcon(
|
||||||
|
|||||||
+2
-5
@@ -1,7 +1,6 @@
|
|||||||
import { resolve } from "node:path";
|
|
||||||
|
|
||||||
import { Menu, Tray, nativeImage } from "electron";
|
import { Menu, Tray, nativeImage } from "electron";
|
||||||
|
|
||||||
|
import trayIconAsset from "../../assets/desktop/icon.png?asset";
|
||||||
import { version } from "../../package.json";
|
import { version } from "../../package.json";
|
||||||
|
|
||||||
import { mainWindow, quitApp } from "./window";
|
import { mainWindow, quitApp } from "./window";
|
||||||
@@ -10,9 +9,7 @@ import { mainWindow, quitApp } from "./window";
|
|||||||
let tray: Tray = null;
|
let tray: Tray = null;
|
||||||
|
|
||||||
// load the tray icon
|
// load the tray icon
|
||||||
const trayIcon = nativeImage.createFromPath(
|
const trayIcon = nativeImage.createFromDataURL(trayIconAsset);
|
||||||
resolve(process.resourcesPath, "icon.png"),
|
|
||||||
);
|
|
||||||
|
|
||||||
// trayIcon.setTemplateImage(true);
|
// trayIcon.setTemplateImage(true);
|
||||||
|
|
||||||
|
|||||||
+7
-10
@@ -1,4 +1,4 @@
|
|||||||
import { join, resolve } from "node:path";
|
import { join } from "node:path";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BrowserWindow,
|
BrowserWindow,
|
||||||
@@ -9,7 +9,8 @@ import {
|
|||||||
nativeImage,
|
nativeImage,
|
||||||
} from "electron";
|
} from "electron";
|
||||||
|
|
||||||
import { setBadgeCount } from "./badges";
|
import windowIconAsset from "../../assets/desktop/icon.png?asset";
|
||||||
|
|
||||||
import { config } from "./config";
|
import { config } from "./config";
|
||||||
import { updateTrayMenu } from "./tray";
|
import { updateTrayMenu } from "./tray";
|
||||||
|
|
||||||
@@ -27,11 +28,7 @@ export const BUILD_URL = new URL(
|
|||||||
let shouldQuit = false;
|
let shouldQuit = false;
|
||||||
|
|
||||||
// load the window icon
|
// load the window icon
|
||||||
const windowIcon = nativeImage.createFromPath(
|
const windowIcon = nativeImage.createFromDataURL(windowIconAsset);
|
||||||
resolve(process.resourcesPath, "icon.png"),
|
|
||||||
);
|
|
||||||
|
|
||||||
console.info(resolve(process.resourcesPath, "icon.png"));
|
|
||||||
|
|
||||||
// windowIcon.setTemplateImage(true);
|
// windowIcon.setTemplateImage(true);
|
||||||
|
|
||||||
@@ -43,7 +40,7 @@ export function createMainWindow() {
|
|||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
minWidth: 300,
|
minWidth: 300,
|
||||||
minHeight: 300,
|
minHeight: 300,
|
||||||
width: 800,
|
width: 1100,
|
||||||
height: 600,
|
height: 600,
|
||||||
backgroundColor: "#191919",
|
backgroundColor: "#191919",
|
||||||
frame: !config.customFrame,
|
frame: !config.customFrame,
|
||||||
@@ -156,8 +153,8 @@ export function createMainWindow() {
|
|||||||
|
|
||||||
// mainWindow.webContents.openDevTools();
|
// mainWindow.webContents.openDevTools();
|
||||||
|
|
||||||
let i = 0;
|
// let i = 0;
|
||||||
setInterval(() => setBadgeCount((++i % 30) + 1), 1000);
|
// setInterval(() => setBadgeCount((++i % 30) + 1), 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+2
-1
@@ -10,6 +10,7 @@
|
|||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"resolveJsonModule": true
|
"resolveJsonModule": true,
|
||||||
|
"types": ["electron-vite/node"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user