Skip to content

Commit 00f5866

Browse files
committed
build: Fix AppImage
1 parent e2bbf9f commit 00f5866

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

.github/scripts/consts.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@
88
fount_app_build = False
99
for line in lines:
1010
if line.startswith("APP_BUILD"):
11-
new_line = f'APP_BUILD = "{"Flatpak" if "--flatpak" in sys.argv else "AppImage" if os.environ.get("RUNNER_OS") == "Linux" else "PyInstaller"}"\n'
11+
new_line = f'APP_BUILD = "{"Flatpak" if "--flatpak" in sys.argv else "AppImage" if "--github" in sys.argv and os.environ.get("RUNNER_OS") == "Linux" else "PyInstaller"}"\n'
1212
new_lines.append(new_line)
1313
fount_app_build = True
1414
else:
1515
new_lines.append(line)
1616

1717
if not fount_app_build:
18-
new_lines.append(f'APP_BUILD = "{"Flatpak" if "--flatpak" in sys.argv else "AppImage" if os.environ.get("RUNNER_OS") == "Linux" else "PyInstaller"}"\n')
18+
new_lines.append(
19+
f'APP_BUILD = "{"Flatpak" if "--flatpak" in sys.argv else "AppImage" if "--github" in sys.argv and os.environ.get("RUNNER_OS") == "Linux" else "PyInstaller"}"\n'
20+
)
1921

2022
with open(os.path.join("nottodbox", "scripts", "version.py"), "w") as f_write:
2123
f_write.writelines(new_lines)

.github/scripts/pyinstaller.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
python3 .github/scripts/consts.py
2-
31
if [ "$RUNNER_OS" == "Linux" ]; then
42
pyinstaller --add-data 'nottodbox/color-schemes/:nottodbox/color-schemes' --add-data 'nottodbox/LICENSE.txt:nottodbox' -F -w -n nottodbox nottodbox/__main__.py
53
elif [ "$RUNNER_OS" == "macOS" ]; then

.github/scripts/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
directory = os.listdir()
77

88
for name in directory:
9-
if "appimage" in name.lower():
9+
if "nottodbox" in name.lower() and "appimage" in name.lower():
1010
shutil.move(name, "dist/nottodbox.AppImage")
1111

1212
elif os.environ.get("RUNNER_OS") == "macOS":

.github/workflows/build.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
- name: Set-up translations
3636
run: python3 .github/scripts/translations.py
3737

38+
- name: Set-up consts
39+
run: python3 .github/scripts/consts.py --github
40+
3841
- name: Build executable
3942
run: bash .github/scripts/pyinstaller.sh
4043

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# AppImage
2+
AppDir/
3+
*.AppImage*
4+
15
# Flatpak
26
.flatpak-builder/
37

@@ -19,7 +23,4 @@ dist/
1923
nottodbox.spec
2024

2125
# Python
22-
*__pycache__
23-
24-
# ruff
25-
fix.txt
26+
*__pycache__

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@
7979
> [!CAUTION]
8080
> Build command tested on bash.
8181
82-
- Build for Linux: `export RUNNER_OS="Linux" ; bash .github/scripts/pyinstaller.sh`
83-
- Build for macOS: `export RUNNER_OS="macOS" ; bash .github/scripts/pyinstaller.sh`
84-
- Build for Windows: `export RUNNER_OS="Windows" ; bash .github/scripts/pyinstaller.sh`
82+
- Build for Linux: `export RUNNER_OS="Linux" ; python3 .github/scripts/consts.py ; bash .github/scripts/pyinstaller.sh`
83+
- Build for macOS: `export RUNNER_OS="macOS" ; python3 .github/scripts/consts.py ; bash .github/scripts/pyinstaller.sh`
84+
- Build for Windows: `export RUNNER_OS="Windows" ; python3 .github/scripts/consts.py ; bash .github/scripts/pyinstaller.sh`
8585
- Now you can find the executable in dist folder.
8686

8787
## Running from source

0 commit comments

Comments
 (0)