Skip to content

Commit ba9932a

Browse files
authored
Merge pull request #678 from 4gray/ci/macos-arch-runners-update
ci/macos-arch-runners-update
2 parents a20143c + 7fa7143 commit ba9932a

File tree

5 files changed

+236
-117
lines changed

5 files changed

+236
-117
lines changed

.github/workflows/build-and-make.yaml

Lines changed: 73 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,24 @@ on:
1515

1616
jobs:
1717
build:
18-
name: Build on ${{ matrix.os }}
19-
runs-on: ${{ matrix.os }}
18+
name: Build on ${{ matrix.os }} ${{ matrix.arch }}
19+
runs-on: ${{ matrix.runner }}
2020
timeout-minutes: 60
2121
strategy:
2222
matrix:
23-
os: [macos-latest, ubuntu-latest, windows-latest]
23+
include:
24+
# macOS builds - separate runners to avoid native module conflicts
25+
- os: macos
26+
runner: macos-15-intel
27+
arch: x64
28+
- os: macos
29+
runner: macos-latest
30+
arch: arm64
31+
# Linux and Windows
32+
- os: linux
33+
runner: ubuntu-latest
34+
- os: windows
35+
runner: windows-latest
2436

2537
steps:
2638
- name: Checkout code
@@ -38,18 +50,18 @@ jobs:
3850
cache: 'pnpm'
3951

4052
- name: Install Linux system dependencies
41-
if: matrix.os == 'ubuntu-latest'
53+
if: matrix.os == 'linux'
4254
run: |
43-
sudo apt-get update
44-
sudo apt-get install --no-install-recommends -y rpm libarchive-tools flatpak flatpak-builder
45-
46-
# Configure Flatpak
47-
# 1. Add the Flathub repository (source of runtimes)
48-
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
49-
50-
# 2. Install the standard Freedesktop Platform and SDK (required by electron-builder)
51-
# We install version 24.08 as a safe default, electron-builder might pick what it needs
52-
flatpak install --user -y flathub org.freedesktop.Platform//24.08 org.freedesktop.Sdk//24.08
55+
sudo apt-get update
56+
sudo apt-get install --no-install-recommends -y rpm libarchive-tools flatpak flatpak-builder
57+
58+
# Configure Flatpak
59+
# 1. Add the Flathub repository (source of runtimes)
60+
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
61+
62+
# 2. Install the standard Freedesktop Platform and SDK (required by electron-builder)
63+
# We install version 24.08 as a safe default, electron-builder might pick what it needs
64+
flatpak install --user -y flathub org.freedesktop.Platform//24.08 org.freedesktop.Sdk//24.08
5365
5466
- name: Install dependencies
5567
run: pnpm install --no-frozen-lockfile
@@ -60,21 +72,32 @@ jobs:
6072
- name: Build backend
6173
run: npm run build:backend
6274

75+
- name: Override macOS arch in electron-builder.json
76+
if: matrix.os == 'macos'
77+
run: |
78+
# Replace the mac arch array with just the target architecture
79+
node -e "
80+
const fs = require('fs');
81+
const pkg = JSON.parse(fs.readFileSync('electron-builder.json', 'utf8'));
82+
pkg.mac.target.arch = ['${{ matrix.arch }}'];
83+
fs.writeFileSync('electron-builder.json', JSON.stringify(pkg, null, 4));
84+
"
85+
6386
- name: Make Electron app
6487
run: npm run make:app
6588

6689
- name: Upload artifacts (macOS)
67-
if: matrix.os == 'macos-latest'
90+
if: matrix.os == 'macos'
6891
uses: actions/upload-artifact@v4
6992
with:
70-
name: macos-artifacts
93+
name: macos-${{ matrix.arch }}-artifacts
7194
path: |
7295
dist/executables/**/*.dmg
7396
dist/executables/**/*.zip
7497
retention-days: 7
7598

7699
- name: Upload artifacts (Linux)
77-
if: matrix.os == 'ubuntu-latest'
100+
if: matrix.os == 'linux'
78101
uses: actions/upload-artifact@v4
79102
with:
80103
name: linux-artifacts
@@ -89,7 +112,7 @@ jobs:
89112
retention-days: 7
90113

91114
- name: Upload artifacts (Windows)
92-
if: matrix.os == 'windows-latest'
115+
if: matrix.os == 'windows'
93116
uses: actions/upload-artifact@v4
94117
with:
95118
name: windows-artifacts
@@ -131,8 +154,10 @@ jobs:
131154
tag_name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || format('test-{0}', github.sha) }}
132155
generate_release_notes: true
133156
files: |
134-
artifacts/macos-artifacts/*.dmg
135-
artifacts/macos-artifacts/*.zip
157+
artifacts/macos-x64-artifacts/*-x64.dmg
158+
artifacts/macos-x64-artifacts/*-x64.zip
159+
artifacts/macos-arm64-artifacts/*-arm64.dmg
160+
artifacts/macos-arm64-artifacts/*-arm64.zip
136161
artifacts/linux-artifacts/*.AppImage
137162
artifacts/linux-artifacts/*.deb
138163
artifacts/linux-artifacts/*.rpm
@@ -145,3 +170,31 @@ jobs:
145170
artifacts/windows-artifacts/*.zip
146171
env:
147172
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
173+
174+
publish-snap:
175+
name: Publish to Snapcraft Store
176+
needs: build
177+
runs-on: ubuntu-latest
178+
# if: startsWith(github.ref, 'refs/tags/v') # Only publish on version tags
179+
env:
180+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft_token }}
181+
182+
steps:
183+
- name: Download snap artifact
184+
uses: actions/download-artifact@v4
185+
with:
186+
name: linux-artifacts
187+
path: artifacts
188+
189+
- name: Setup Snapcraft
190+
uses: samuelmeuli/action-snapcraft@v3
191+
192+
- name: Publish all snaps to edge channel
193+
run: |
194+
# Find and publish all snap files
195+
for SNAP_FILE in artifacts/*.snap; do
196+
if [ -f "$SNAP_FILE" ]; then
197+
echo "Publishing: $SNAP_FILE"
198+
snapcraft upload --release=edge "$SNAP_FILE"
199+
fi
200+
done

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,63 @@ sudo emerge iptvnator-bin
108108

109109
<a href="https://github.com/sponsors/4gray" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-green.png" alt="Buy Me A Coffee" width="185"></a>
110110

111+
## Troubleshooting
112+
113+
### macOS: "App is damaged and can't be opened"
114+
115+
Due to Apple's Gatekeeper security and code signing requirements, you may need to remove the quarantine flag from the downloaded application:
116+
117+
```bash
118+
xattr -c /Applications/IPTVnator.app
119+
```
120+
121+
Alternatively, if the app is located in a different directory:
122+
123+
```bash
124+
xattr -c ~/Downloads/IPTVnator.app
125+
```
126+
127+
### Linux: chrome-sandbox Issues
128+
129+
If you encounter the following error when launching IPTVnator:
130+
131+
```
132+
The SUID sandbox helper binary was found, but is not configured correctly.
133+
Rather than run without sandboxing I'm aborting now.
134+
You need to make sure that chrome-sandbox is owned by root and has mode 4755.
135+
```
136+
137+
**Solution 1: Fix chrome-sandbox permissions (Recommended for .deb/.rpm installations)**
138+
139+
Navigate to the IPTVnator installation directory and run:
140+
141+
```bash
142+
sudo chown root:root chrome-sandbox
143+
sudo chmod 4755 chrome-sandbox
144+
```
145+
146+
**Solution 2: Launch with --no-sandbox flag**
147+
148+
Edit the desktop launcher file to add the `--no-sandbox` flag:
149+
150+
1. Find your desktop file location:
151+
- **Ubuntu/Debian**: `~/.local/share/applications/iptvnator.desktop`
152+
- **System-wide**: `/usr/share/applications/iptvnator.desktop`
153+
154+
2. Edit the file and modify the `Exec` line:
155+
156+
```
157+
Exec=iptvnator --no-sandbox %U
158+
```
159+
160+
3. Save the file and relaunch the application from your application menu.
161+
162+
Alternatively, you can launch IPTVnator from the terminal with the flag:
163+
164+
```bash
165+
iptvnator --no-sandbox
166+
```
167+
111168
## How to Build and Develop
112169

113170
Requirements:

electron-builder.json

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"appId": "com.fourgray.iptvnator",
3+
"productName": "IPTVnator",
4+
"artifactName": "${name}-${version}-${os}-${arch}.${ext}",
5+
"directories": {
6+
"buildResources": "dist/apps",
7+
"output": "dist/executables"
8+
},
9+
"files": [
10+
{
11+
"from": "dist/apps/remote-control-web",
12+
"to": "remote-control-web",
13+
"filter": ["**/*"]
14+
},
15+
"electron-backend/**/*",
16+
"web/**/*",
17+
"!**/*.map"
18+
],
19+
"asarUnpack": ["**/better-sqlite3/**"],
20+
"extraMetadata": {
21+
"main": "electron-backend/main.js"
22+
},
23+
"extraResources": ["dist/apps/electron-backend/workers"],
24+
"mac": {
25+
"target": {
26+
"target": "dmg",
27+
"arch": ["x64", "arm64"]
28+
},
29+
"category": "public.app-category.video",
30+
"identity": null,
31+
"gatekeeperAssess": false,
32+
"hardenedRuntime": false,
33+
"entitlements": null,
34+
"entitlementsInherit": null,
35+
"icon": "apps/web/src/assets/icons/favicon.icns"
36+
},
37+
"linux": {
38+
"category": "Video",
39+
"target": [
40+
{
41+
"target": "AppImage",
42+
"arch": ["x64", "armv7l", "arm64"]
43+
},
44+
{
45+
"target": "deb",
46+
"arch": ["x64", "armv7l", "arm64"]
47+
},
48+
{
49+
"target": "Snap",
50+
"arch": ["x64", "armv7l"]
51+
},
52+
{
53+
"target": "rpm",
54+
"arch": ["x64"]
55+
},
56+
{
57+
"target": "pacman",
58+
"arch": ["x64"]
59+
},
60+
{
61+
"target": "flatpak",
62+
"arch": ["x64"]
63+
}
64+
],
65+
"artifactName": "${name}-${version}-${os}-${arch}.${ext}",
66+
"icon": "apps/web/src/assets/icons"
67+
},
68+
"afterPack": "electron-builder-sandbox-fix",
69+
"snap": {
70+
"confinement": "strict",
71+
"grade": "stable",
72+
"summary": "IPTV application for M3U playlists, Xtream Codes API, and Stalker portals",
73+
"environment": {
74+
"DISABLE_WAYLAND": "1"
75+
}
76+
},
77+
"win": {
78+
"compression": "maximum",
79+
"target": [
80+
{
81+
"target": "nsis",
82+
"arch": ["x64"]
83+
}
84+
],
85+
"artifactName": "${name}-${version}-windows-${arch}-setup.${ext}",
86+
"icon": "apps/web/src/assets/icons/icon.png"
87+
},
88+
"nsis": {
89+
"artifactName": "${name}-${version}-windows-${arch}-setup.${ext}"
90+
}
91+
}

package-lock.json

Lines changed: 13 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)