Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit a32eced

Browse files
committed
Refactor maker configurations and github workflow
1 parent 2406822 commit a32eced

File tree

11 files changed

+86
-28
lines changed

11 files changed

+86
-28
lines changed

.github/workflows/release.yml

+14
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [ubuntu-latest, windows-latest, macos-latest]
13+
arch: [x64, arm64]
1314
runs-on: ${{ matrix.os }}
1415

1516
steps:
@@ -24,6 +25,19 @@ jobs:
2425
- name: Install dependencies
2526
run: npm install
2627

28+
- name: Set up Wine and Mono for Windows build on macOS
29+
if: matrix.os == 'macos-latest'
30+
run: |
31+
brew install --cask wine-stable mono
32+
33+
- name: Build Electron app
34+
run: |
35+
npm run make -- --arch=${{ matrix.arch }}
36+
env:
37+
ELECTRON_CACHE: ${{ runner.temp }}/electron
38+
npm_config_arch: ${{ matrix.arch }}
39+
npm_config_platform: ${{ matrix.os }}
40+
2741
- name: Publish to GitHub Releases
2842
run: npm run publish
2943
env:

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Node.js
2020
uses: actions/setup-node@v2
2121
with:
22-
node-version: '14'
22+
node-version: '18'
2323

2424
- name: Install dependencies
2525
run: npm install

forge.config.ts

+53-25
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,70 @@
11
import type { ForgeConfig } from '@electron-forge/shared-types';
2-
import { MakerSquirrel } from '@electron-forge/maker-squirrel';
3-
import { MakerZIP } from '@electron-forge/maker-zip';
4-
import { MakerDeb } from '@electron-forge/maker-deb';
5-
import { MakerRpm } from '@electron-forge/maker-rpm';
62
import { VitePlugin } from '@electron-forge/plugin-vite';
73
import { FusesPlugin } from '@electron-forge/plugin-fuses';
84
import { FuseV1Options, FuseVersion } from '@electron/fuses';
95
import { PublisherGithub } from '@electron-forge/publisher-github';
6+
import packageJson from './package.json';
7+
import path from 'node:path';
8+
9+
const { version } = packageJson;
10+
const iconDir = path.resolve(__dirname, 'src', 'assets', 'images', 'icons');
11+
12+
const commonLinuxConfig = {
13+
categories: ['Video', 'Utility'],
14+
mimeType: ['x-scheme-handler/comet'],
15+
};
1016

1117
const config: ForgeConfig = {
1218
packagerConfig: {
13-
name: 'comet',
14-
executableName: 'Comet',
15-
icon: 'src/assets/images/icon/icon',
19+
name: 'Comet',
20+
executableName: 'comet',
21+
icon: 'src/assets/images/icons/icon',
22+
appBundleId: 'com.thavarshan.comet',
23+
appCategoryType: 'public.app-category.video',
1624
asar: {
1725
unpack: "**/node_modules/ffmpeg-static/**"
1826
},
1927
},
2028
rebuildConfig: {},
2129
makers: [
22-
new MakerSquirrel({
23-
setupIcon: 'src/assets/images/icon/icon.ico'
24-
}),
25-
new MakerZIP({}, ['win32']),
26-
new MakerZIP({}, ['darwin']),
27-
new MakerZIP({}, ['linux']),
28-
new MakerRpm({}, ['x64']),
29-
new MakerRpm({}, ['arm64']),
30-
new MakerDeb({
31-
options: {
32-
icon: 'src/assets/images/icon/icon.png',
33-
}
34-
}, ['x64']),
35-
new MakerDeb({
36-
options: {
37-
icon: 'src/assets/images/icon/icon.png',
38-
}
39-
}, ['arm64']),
30+
{
31+
name: '@electron-forge/maker-squirrel',
32+
platforms: ['win32'],
33+
config: (arch: string) => ({
34+
name: 'Comet',
35+
authors: 'Jerome Thayananthajothy',
36+
exe: 'Comet.exe',
37+
noMsi: true,
38+
setupExe: `comet-${version}-win32-${arch}-setup.exe`,
39+
setupIcon: path.resolve(iconDir, 'setup-icon.ico'),
40+
}),
41+
},
42+
{
43+
name: '@electron-forge/maker-zip',
44+
platforms: ['darwin'],
45+
config: {
46+
name: 'Comet'
47+
},
48+
},
49+
{
50+
name: '@electron-forge/maker-deb',
51+
platforms: ['linux'],
52+
config: commonLinuxConfig,
53+
},
54+
{
55+
name: '@electron-forge/maker-rpm',
56+
platforms: ['linux'],
57+
config: commonLinuxConfig,
58+
},
59+
{
60+
name: '@reforged/maker-appimage',
61+
platforms: ['linux'],
62+
config: {
63+
options: {
64+
categories: commonLinuxConfig.categories,
65+
},
66+
},
67+
},
4068
],
4169
plugins: [
4270
new VitePlugin({

index.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html lang="en">
22
<html>
33
<head>
44
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
56
<title>☄️ Comet | Video Converter</title>
7+
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self' https: data:; media-src 'none'; child-src 'self'; object-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self' https: sentry-ipc:; font-src 'self' https:;">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
69
</head>
710
<body style="font-family: sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #334155; background-color: #fff; min-height: 100%; display: flex; flex-direction: column; overflow-anchor: none;" scroll-region="">
811
<div id="app" style="overflow: hidden;"></div>

package.json

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
{
22
"name": "comet",
33
"productName": "Comet",
4+
"private": true,
45
"version": "0.0.2",
56
"description": "A simple video converter",
6-
"keywords": [],
7+
"keywords": [
8+
"comet",
9+
"video",
10+
"converter",
11+
"ffmpeg"
12+
],
713
"author": {
814
"name": "Jerome Thayananthajothy",
915
"email": "[email protected]"
1016
},
17+
"homepage": "https://comet.thavarshan.com",
1118
"repository": {
1219
"type": "git",
1320
"url": "https://github.com/stellar-comet/comet.git"
@@ -16,6 +23,9 @@
1623
"url": "https://github.com/stellar-comet/comet/issues"
1724
},
1825
"license": "MIT",
26+
"config": {
27+
"forge": "./forge.config.ts"
28+
},
1929
"main": ".vite/build/main.js",
2030
"scripts": {
2131
"start": "electron-forge start",
@@ -62,6 +72,9 @@
6272
"typescript": "~4.5.4",
6373
"vite": "^5.4.2"
6474
},
75+
"engines": {
76+
"node": ">= 20.10.0"
77+
},
6578
"build": {
6679
"asarUnpack": [
6780
"node_modules/ffmpeg-static/bin/${os}/${arch}/ffmpeg",

src/assets/images/icon/icon.ico

-4.19 KB
Binary file not shown.
File renamed without changes.

src/assets/images/icons/icon.ico

176 KB
Binary file not shown.
File renamed without changes.
179 KB
Binary file not shown.

0 commit comments

Comments
 (0)