Skip to content

Commit 6df0ddf

Browse files
committed
add flatpak, fix no vsync typo
1 parent 80bc961 commit 6df0ddf

File tree

13 files changed

+158
-8
lines changed

13 files changed

+158
-8
lines changed

.github/workflows/build.yml

100644100755
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,23 @@ jobs:
4040
with:
4141
name: app-linux
4242
path: dist/*.AppImage
43+
44+
flatpak:
45+
runs-on: ubuntu-latest
46+
needs: build
47+
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v3
51+
52+
- name: Build flatpak
53+
run: |
54+
npm run flatpak
55+
56+
- name: Upload Flatpak
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: app-flatpak
60+
path: |
61+
webmc.flatpak
62+
install-flatpak.sh

.gitignore

100644100755
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
**/.DS_Store
22
dist/
33
node_modules/
4-
build/
4+
build/
5+
build-dir/
6+
.flatpak-builder/
7+
tmp/
8+
repo/

README.md

100644100755
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
[**macOS**](https://nightly.link/WebMCDevelopment/WebMCDesktop/workflows/build/main/app-macOS.zip)
66

7-
[**Linux**](https://nightly.link/WebMCDevelopment/WebMCDesktop/workflows/build/main/app-linux.zip)
7+
[**Linux**](https://nightly.link/WebMCDevelopment/WebMCDesktop/workflows/build/main/app-linux.zip)
8+
9+
[**FlatPak**](https://nightly.link/WebMCDevelopment/WebMCDesktop/workflows/build/main/app-flatpak.zip)

WebMC.desktop

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Desktop Entry]
2+
Name=WebMC
3+
Comment=Launch WebMC Desktop
4+
Exec=run.sh
5+
Icon=xyz.webmc.desktop
6+
Terminal=false
7+
Type=Application
8+
Categories=Game;

build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
32
ARGS="$*"
43

54
if [ -z "$ARGS" ]; then

flatpak.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if ! [ -d "dist/linux-unpacked" ]; then
5+
echo "App not found, please build first."
6+
exit 1
7+
fi
8+
9+
if ! command -v flatpak &> /dev/null; then
10+
sudo apt update
11+
sudo apt install -y flatpak flatpak-builder
12+
fi
13+
14+
if ! command -v convert &> /dev/null; then
15+
sudo apt install -y imagemagick
16+
fi
17+
18+
if ! flatpak remotes | grep -q flathub; then
19+
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
20+
fi
21+
22+
if ! flatpak info org.freedesktop.Platform//23.08 &> /dev/null; then
23+
flatpak install -y --noninteractive --assumeyes --installation=system flathub org.freedesktop.Platform//23.08
24+
fi
25+
26+
if ! flatpak info org.freedesktop.Sdk//23.08 &> /dev/null; then
27+
flatpak install -y --noninteractive --assumeyes --installation=system flathub org.freedesktop.Sdk//23.08
28+
fi
29+
30+
if ! flatpak info org.electronjs.Electron2.BaseApp//23.08 &> /dev/null; then
31+
flatpak install -y --noninteractive --assumeyes --installation=system flathub org.electronjs.Electron2.BaseApp//23.08
32+
fi
33+
34+
if ! flatpak info org.freedesktop.Sdk.Extension.node18//23.08 &> /dev/null; then
35+
flatpak install -y --noninteractive --assumeyes --installation=system flathub org.freedesktop.Sdk.Extension.node18//23.08
36+
fi
37+
38+
mkdir -p tmp
39+
cp -r dist/linux-unpacked/. tmp/app/
40+
chmod +x tmp/app/webmc
41+
convert build/icon.iconset/icon_512x512@2x.png -resize 512x512\! tmp/icon.png
42+
cp WebMC.desktop tmp/
43+
cp zypak-wrapper.sh tmp/
44+
45+
flatpak-builder --force-clean build-dir xyz.webmc.desktop.yml
46+
flatpak build-export repo build-dir
47+
flatpak build-bundle repo webmc.flatpak xyz.webmc.desktop
48+
49+
rm -rf .flatpak-builder
50+
rm -rf build-dir
51+
rm -rf repo
52+
rm -rf tmp

index.js

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { app, BrowserWindow, screen, Menu } = require('electron')
44

55
Menu.setApplicationMenu(null)
66
if (process.argv.includes('--portable')) app.setPath('userData', path.join(__dirname, 'data'));
7-
if (!process.argv.includes('--vsync')) {
7+
if (process.argv.includes('--no-vsync')) {
88
app.commandLine.appendSwitch('disable-frame-rate-limit');
99
app.commandLine.appendSwitch('disable-gpu-vsync');
1010
}

inject.css

100644100755
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.settings .setting:nth-child(5),
21
.settings .setting.popupTab {
32
display: none !important;
43
}

install-flatpak.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
flatpak install --user --assumeyes webmc.flatpak

package-lock.json

100644100755
File mode changed.

0 commit comments

Comments
 (0)