From e55c44f18d49c1257ba28716090a9680ad4de8a4 Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Fri, 4 Oct 2024 20:35:44 +0300 Subject: [PATCH 1/5] WineSettings: show correct failure reason. --- rare/components/tabs/settings/widgets/wine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rare/components/tabs/settings/widgets/wine.py b/rare/components/tabs/settings/widgets/wine.py index bdbee3621..9ed2822de 100644 --- a/rare/components/tabs/settings/widgets/wine.py +++ b/rare/components/tabs/settings/widgets/wine.py @@ -39,7 +39,7 @@ def __init__(self, parent=None): path="", file_mode=QFileDialog.FileMode.ExistingFile, name_filters=["wine", "wine64"], - edit_func=lambda text: (os.path.exists(text) or not text, text, IndicatorReasonsCommon.DIR_NOT_EXISTS), + edit_func=lambda text: (os.path.isfile(text) or not text, text, IndicatorReasonsCommon.FILE_NOT_EXISTS), save_func=self.save_exec, ) From 3f997734b28d9c19a3f94edf641b77c12b92bed4 Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Thu, 10 Oct 2024 13:18:10 +0300 Subject: [PATCH 2/5] Rare: enforce utf-8 encoding in some places, should fix subtle issues on Windows Fixes: #463 --- rare/commands/launcher/console_dialog.py | 2 +- rare/models/game.py | 4 ++-- rare/resources/static_css/stylesheet.py | 2 +- rare/shared/image_manager.py | 2 +- rare/shared/rare_core.py | 2 +- rare/shared/wrappers.py | 4 ++-- rare/utils/compat/steam.py | 12 ++++++------ rare/utils/steam_grades.py | 2 +- rare/utils/steam_shortcuts.py | 6 +++--- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/rare/commands/launcher/console_dialog.py b/rare/commands/launcher/console_dialog.py index ee83b657b..8b07e9737 100644 --- a/rare/commands/launcher/console_dialog.py +++ b/rare/commands/launcher/console_dialog.py @@ -102,7 +102,7 @@ def save(self): if ok: if "." not in file: file += ".log" - with open(file, "w") as f: + with open(file, "w", encoding="utf-8") as f: f.write(self.console_edit.toPlainText()) f.close() self.save_button.setText(self.tr("Saved")) diff --git a/rare/models/game.py b/rare/models/game.py index 6c4e28ba7..a2c35d9f4 100644 --- a/rare/models/game.py +++ b/rare/models/game.py @@ -152,7 +152,7 @@ def __load_metadata_json() -> Dict: metadata = {} file = os.path.join(data_dir(), "game_meta.json") try: - with open(file, "r") as f: + with open(file, "r", encoding="utf-8") as f: metadata = json.load(f) except FileNotFoundError: logger.info("%s does not exist", file) @@ -175,7 +175,7 @@ def __save_metadata(self): metadata: Dict = self.__load_metadata_json() # pylint: disable=unsupported-assignment-operation metadata[self.app_name] = vars(self.metadata) - with open(os.path.join(data_dir(), "game_meta.json"), "w+") as file: + with open(os.path.join(data_dir(), "game_meta.json"), "w+", encoding="utf-8") as file: json.dump(metadata, file, indent=2) def update_game(self): diff --git a/rare/resources/static_css/stylesheet.py b/rare/resources/static_css/stylesheet.py index e7f3f3f14..384024d95 100644 --- a/rare/resources/static_css/stylesheet.py +++ b/rare/resources/static_css/stylesheet.py @@ -172,7 +172,7 @@ def css_name(widget: Union[wrappertype, QObject, Type], subwidget: str = ""): if __name__ == "__main__": - with open("stylesheet.qss", "w") as qss: + with open("stylesheet.qss", "w", encoding="utf-8") as qss: qss.write(f'\n/* This file is auto-generated from "{os.path.basename(__file__)}". DO NOT EDIT!!! */\n\n') qss.write(css.toString()) diff --git a/rare/shared/image_manager.py b/rare/shared/image_manager.py index 40db6b212..8ab0e8468 100644 --- a/rare/shared/image_manager.py +++ b/rare/shared/image_manager.py @@ -237,7 +237,7 @@ def __download(self, updates: List, json_data: Dict, game: Game, use_async: bool json_data["size"] = {"w": ImageSize.Tall.size.width(), "h": ImageSize.Tall.size.height()} # write image.json - with open(self.__img_json(game.app_name), "w") as file: + with open(self.__img_json(game.app_name), "w", encoding="utf-8") as file: json.dump(json_data, file) return bool(updates) diff --git a/rare/shared/rare_core.py b/rare/shared/rare_core.py index 87a430e7c..a9b3a710d 100644 --- a/rare/shared/rare_core.py +++ b/rare/shared/rare_core.py @@ -156,7 +156,7 @@ def core(self, init: bool = False) -> LegendaryCore: else: path = os.path.expanduser('~/.config/legendary') logger.info("Creating config in path: %s", config_path) - with open(os.path.join(path, "config.ini"), "w") as config_file: + with open(os.path.join(path, "config.ini"), "w", encoding="utf-8") as config_file: config_file.write("[Legendary]") self.__core = LegendaryCore() diff --git a/rare/shared/wrappers.py b/rare/shared/wrappers.py index d99b40d2b..d6eaca9ee 100644 --- a/rare/shared/wrappers.py +++ b/rare/shared/wrappers.py @@ -19,7 +19,7 @@ def __init__(self): self.__file = os.path.join(config_dir(), "wrappers.json") self.__wrappers_dict = {} try: - with open(self.__file) as f: + with open(self.__file, "r", encoding="utf-8") as f: self.__wrappers_dict = json.load(f) except FileNotFoundError: logger.info("%s does not exist", self.__file) @@ -114,7 +114,7 @@ def __save_wrappers(self): self.__wrappers_dict["wrappers"] = self.__wrappers self.__wrappers_dict["applists"] = self.__applists - with open(os.path.join(self.__file), "w+") as f: + with open(os.path.join(self.__file), "w+", encoding="utf-8") as f: json.dump(self.__wrappers_dict, f, default=lambda o: vars(o), indent=2) diff --git a/rare/utils/compat/steam.py b/rare/utils/compat/steam.py index 0bcc59b00..c159442eb 100644 --- a/rare/utils/compat/steam.py +++ b/rare/utils/compat/steam.py @@ -23,7 +23,7 @@ def find_steam() -> Optional[str]: def find_libraries(steam_path: str) -> Set[str]: vdf_path = os.path.join(steam_path, "config", "libraryfolders.vdf") - with open(vdf_path, "r") as f: + with open(vdf_path, "r", encoding="utf-8") as f: libraryfolders = vdf.load(f)["libraryfolders"] # libraries = [os.path.join(folder["path"], "steamapps") for key, folder in libraryfolders.items()] libraries = {os.path.join(folder["path"], "steamapps") for key, folder in libraryfolders.items()} @@ -165,7 +165,7 @@ def find_appmanifests(library: str) -> List[dict]: appmanifests = [] for entry in os.scandir(library): if entry.is_file() and entry.name.endswith(".acf"): - with open(os.path.join(library, entry.name), "r") as f: + with open(os.path.join(library, entry.name), "r", encoding="utf-8") as f: appmanifest = vdf.load(f) appmanifests.append(appmanifest) return appmanifests @@ -206,7 +206,7 @@ def find_runtimes(steam_path: str, library: str) -> Dict[str, SteamRuntime]: folder = appmanifest["AppState"]["installdir"] tool_path = os.path.join(common, folder) if os.path.isfile(vdf_file := os.path.join(tool_path, "toolmanifest.vdf")): - with open(vdf_file, "r") as f: + with open(vdf_file, "r", encoding="utf-8") as f: toolmanifest = vdf.load(f) if toolmanifest["manifest"]["compatmanager_layer_name"] == "container-runtime": runtimes.update( @@ -231,7 +231,7 @@ def find_protons(steam_path: str, library: str) -> List[ProtonTool]: folder = appmanifest["AppState"]["installdir"] tool_path = os.path.join(common, folder) if os.path.isfile(vdf_file := os.path.join(tool_path, "toolmanifest.vdf")): - with open(vdf_file, "r") as f: + with open(vdf_file, "r", encoding="utf-8") as f: toolmanifest = vdf.load(f) if toolmanifest["manifest"]["compatmanager_layer_name"] == "proton": protons.append( @@ -270,7 +270,7 @@ def find_compatibility_tools(steam_path: str) -> List[CompatibilityTool]: if not os.path.isfile(tool_vdf): continue - with open(tool_vdf, "r") as f: + with open(tool_vdf, "r", encoding="utf-8") as f: compatibilitytool = vdf.load(f) entry_tools = compatibilitytool["compatibilitytools"]["compat_tools"] @@ -285,7 +285,7 @@ def find_compatibility_tools(steam_path: str) -> List[CompatibilityTool]: if not os.path.isfile(manifest_vdf): continue - with open(manifest_vdf, "r") as f: + with open(manifest_vdf, "r", encoding="utf-8") as f: manifest = vdf.load(f) tools.append( diff --git a/rare/utils/steam_grades.py b/rare/utils/steam_grades.py index 49b60289d..e79b173e6 100644 --- a/rare/utils/steam_grades.py +++ b/rare/utils/steam_grades.py @@ -93,7 +93,7 @@ def load_json() -> dict: ids = {} for app in apps: ids[app["name"]] = app["appid"] - with open(file, "w") as f: + with open(file, "w", encoding="utf-8") as f: f.write(orjson.dumps(ids).decode("utf-8")) return ids else: diff --git a/rare/utils/steam_shortcuts.py b/rare/utils/steam_shortcuts.py index 6fee380cd..d38a4c7aa 100644 --- a/rare/utils/steam_shortcuts.py +++ b/rare/utils/steam_shortcuts.py @@ -44,7 +44,7 @@ def find_steam_users(steam_path: str) -> List[SteamUser]: vdf_path = os.path.join(steam_path, "config", "loginusers.vdf") if not os.path.exists(vdf_path): return _users - with open(vdf_path, 'r') as f: + with open(vdf_path, "r", encoding="utf-8") as f: users = vdf.load(f).get("users", {}) for long_id, user in users.items(): _users.append(SteamUser(long_id, user)) @@ -56,7 +56,7 @@ def _load_shortcuts(steam_path: str, user: SteamUser) -> Dict[str, SteamShortcut vdf_path = os.path.join(steam_path, "userdata", str(user.short_id), "config", "shortcuts.vdf") if not os.path.exists(vdf_path): return _shortcuts - with open(vdf_path, 'rb') as f: + with open(vdf_path, "rb") as f: shortcuts = vdf.binary_load(f).get("shortcuts", {}) for idx, shortcut in shortcuts.items(): _shortcuts[idx] = SteamShortcut.from_dict(shortcut) @@ -66,7 +66,7 @@ def _load_shortcuts(steam_path: str, user: SteamUser) -> Dict[str, SteamShortcut def _save_shortcuts(steam_path: str, user: SteamUser, shortcuts: Dict[str, SteamShortcut]) -> None: _shortcuts = {k: asdict(v) for k, v in shortcuts.items()} vdf_path = os.path.join(steam_path, "userdata", str(user.short_id), "config", "shortcuts.vdf") - with open(vdf_path, 'wb') as f: + with open(vdf_path, "wb") as f: vdf.binary_dump({"shortcuts": _shortcuts}, f) From 859d161e428a2041773e6094366d9b5beb4d2d9b Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Thu, 10 Oct 2024 14:37:52 +0300 Subject: [PATCH 3/5] workflows: update workflows * Add linux and macos nuitka builds, disabled * Disable cx-freeze windows portable build * Enable nuitka windows portable build --- .github/workflows/job_cx-freeze-zip.yml | 6 +- .github/workflows/job_nuitka-linux.yml | 71 +++++++++++++++++++ .github/workflows/job_nuitka-macos.yml | 71 +++++++++++++++++++ .github/workflows/job_nuitka-win.yml | 10 +-- .../{job_release.yml => job_publish.yml} | 4 +- .github/workflows/release.yml | 23 +++--- .github/workflows/snapshot.yml | 23 +++--- misc/nuitka_build.ps1 | 3 +- misc/nuitka_build.sh | 2 +- 9 files changed, 178 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/job_nuitka-linux.yml create mode 100644 .github/workflows/job_nuitka-macos.yml rename .github/workflows/{job_release.yml => job_publish.yml} (96%) diff --git a/.github/workflows/job_cx-freeze-zip.yml b/.github/workflows/job_cx-freeze-zip.yml index 31acadb79..5bd79b499 100644 --- a/.github/workflows/job_cx-freeze-zip.yml +++ b/.github/workflows/job_cx-freeze-zip.yml @@ -30,10 +30,10 @@ jobs: run: cxfreeze -c rare/main.py --target-dir dist --target-name rare --icon rare/resources/images/Rare.ico -OO --base-name Win32GUI - name: Compress run: | - python -c "import shutil; shutil.make_archive('Rare-Windows', 'zip', 'dist')" + python -c "import shutil; shutil.make_archive('Rare', 'zip', 'rare.dist')" - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: Rare-Windows-${{ inputs.version }}.zip - path: Rare-Windows.zip \ No newline at end of file + name: Rare-portable-windows-${{ inputs.version }}.zip + path: Rare.zip diff --git a/.github/workflows/job_nuitka-linux.yml b/.github/workflows/job_nuitka-linux.yml new file mode 100644 index 000000000..175593ab5 --- /dev/null +++ b/.github/workflows/job_nuitka-linux.yml @@ -0,0 +1,71 @@ +name: job_nuitka-linux + +on: + workflow_call: + inputs: + version: + required: true + type: string + +jobs: + build: + name: Build + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + cache: pip + python-version: '3.12' + check-latest: true + architecture: x64 + - name: Install build dependencies + run: pip3 install nuitka ordered-set + - name: Install target dependencies + run: | + pip3 install -r requirements.txt + pip3 install -r requirements-presence.txt + - name: Build + run: >- + python -m nuitka + --assume-yes-for-downloads + --mingw64 + --lto=no + --jobs=4 + --static-libpython=no + --standalone + --enable-plugin=anti-bloat + --enable-plugin=pyside6 + --show-modules + --show-anti-bloat-changes + --follow-stdlib + --follow-imports + --nofollow-import-to="*.tests" + --nofollow-import-to="*.distutils" + --nofollow-import-to="distutils" + --nofollow-import-to="unittest" + --nofollow-import-to="pydoc" + --nofollow-import-to="tkinter" + --nofollow-import-to="test" + --prefer-source-code + --include-package=pypresence + --include-package-data=qtawesome + --include-data-dir=rare/resources/images/=rare/resources/images/ + --include-data-files=rare/resources/languages/rare_*.qm=rare/resources/languages/ + --windows-icon-from-ico=rare/resources/images/Rare.ico + --windows-company-name=RareDevs + --windows-product-name=Rare + --windows-file-description=rare.exe + --windows-file-version=${{ inputs.version }} + --windows-product-version=${{ inputs.version }} + --windows-console-mode=disable + rare + - name: Compress + run: | + python -c "import shutil; shutil.make_archive('Rare', 'zip', 'rare.dist')" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: Rare-portable-linux-${{ inputs.version }}.zip + path: Rare.zip diff --git a/.github/workflows/job_nuitka-macos.yml b/.github/workflows/job_nuitka-macos.yml new file mode 100644 index 000000000..9b70fedfe --- /dev/null +++ b/.github/workflows/job_nuitka-macos.yml @@ -0,0 +1,71 @@ +name: job_nuitka-macos + +on: + workflow_call: + inputs: + version: + required: true + type: string + +jobs: + build: + name: Build + runs-on: "macos-latest" + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + cache: pip + python-version: '3.12' + check-latest: true + architecture: x64 + - name: Install build dependencies + run: pip3 install nuitka ordered-set + - name: Install target dependencies + run: | + pip3 install -r requirements.txt + pip3 install -r requirements-presence.txt + - name: Build + run: >- + python -m nuitka + --assume-yes-for-downloads + --mingw64 + --lto=no + --jobs=4 + --static-libpython=no + --standalone + --enable-plugin=anti-bloat + --enable-plugin=pyside6 + --show-modules + --show-anti-bloat-changes + --follow-stdlib + --follow-imports + --nofollow-import-to="*.tests" + --nofollow-import-to="*.distutils" + --nofollow-import-to="distutils" + --nofollow-import-to="unittest" + --nofollow-import-to="pydoc" + --nofollow-import-to="tkinter" + --nofollow-import-to="test" + --prefer-source-code + --include-package=pypresence + --include-package-data=qtawesome + --include-data-dir=rare/resources/images/=rare/resources/images/ + --include-data-files=rare/resources/languages/rare_*.qm=rare/resources/languages/ + --windows-icon-from-ico=rare/resources/images/Rare.ico + --windows-company-name=RareDevs + --windows-product-name=Rare + --windows-file-description=rare.exe + --windows-file-version=${{ inputs.version }} + --windows-product-version=${{ inputs.version }} + --windows-console-mode=disable + rare + - name: Compress + run: | + python -c "import shutil; shutil.make_archive('Rare', 'zip', 'rare.dist')" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: Rare-portable-macos-${{ inputs.version }}.zip + path: Rare.zip diff --git a/.github/workflows/job_nuitka-win.yml b/.github/workflows/job_nuitka-win.yml index 1ee839aa9..44b60f2e9 100644 --- a/.github/workflows/job_nuitka-win.yml +++ b/.github/workflows/job_nuitka-win.yml @@ -30,7 +30,7 @@ jobs: python -m nuitka --assume-yes-for-downloads --msvc=latest - --lto=yes + --lto=no --jobs=4 --static-libpython=no --standalone @@ -51,7 +51,7 @@ jobs: --include-package=pypresence --include-package-data=qtawesome --include-data-dir=rare\resources\images\=rare\resources\images\ - --include-data-files=rare\resources\languages\=rare\resources\languages\="rare_*.qm" + --include-data-files=rare\resources\languages\rare_*.qm=rare\resources\languages\ --windows-icon-from-ico=rare\resources\images\Rare.ico --windows-company-name=RareDevs --windows-product-name=Rare @@ -62,10 +62,10 @@ jobs: rare - name: Compress run: | - python -c "import shutil; shutil.make_archive('Rare-Windows', 'zip', 'rare.dist')" + python -c "import shutil; shutil.make_archive('Rare', 'zip', 'rare.dist')" - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: Rare-Windows-${{ inputs.version }}.zip - path: Rare-Windows.zip + name: Rare-portable-windows-${{ inputs.version }}.zip + path: Rare.zip diff --git a/.github/workflows/job_release.yml b/.github/workflows/job_publish.yml similarity index 96% rename from .github/workflows/job_release.yml rename to .github/workflows/job_publish.yml index 25e3e1231..ef873978d 100644 --- a/.github/workflows/job_release.yml +++ b/.github/workflows/job_publish.yml @@ -1,4 +1,4 @@ -name: job_release +name: job_publish on: workflow_call: @@ -21,7 +21,7 @@ on: jobs: release: - name: Upload + name: Publish runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index adc29d51c..91480e703 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,7 @@ jobs: ubuntu-release: needs: ubuntu name: Ubuntu - uses: ./.github/workflows/job_release.yml + uses: ./.github/workflows/job_publish.yml with: version: ${{ github.ref_name }} file1: Rare.deb @@ -49,7 +49,7 @@ jobs: appimage-release: needs: appimage name: AppImage - uses: ./.github/workflows/job_release.yml + uses: ./.github/workflows/job_publish.yml with: version: ${{ github.ref_name }} file1: Rare.AppImage @@ -58,7 +58,7 @@ jobs: name2: Rare-${{ github.ref_name }}.AppImage.zsync nuitka-win: - if: ${{ false }} + if: ${{ true }} name: Nuitka Windows uses: ./.github/workflows/job_nuitka-win.yml with: @@ -66,11 +66,11 @@ jobs: nuitka-win-release: needs: nuitka-win name: Nuitka Windows - uses: ./.github/workflows/job_release.yml + uses: ./.github/workflows/job_publish.yml with: version: ${{ github.ref_name }} - file1: Rare-Windows.zip - name1: Rare-Windows-${{ github.ref_name }}.zip + file1: Rare-portable-windows.zip + name1: Rare-portable-windows-${{ github.ref_name }}.zip cx-freeze-msi: name: cx-Freeze msi @@ -80,13 +80,14 @@ jobs: cx-freeze-msi-release: needs: cx-freeze-msi name: cx-Freeze msi - uses: ./.github/workflows/job_release.yml + uses: ./.github/workflows/job_publish.yml with: version: ${{ github.ref_name }} file1: Rare.msi name1: Rare-${{ github.ref_name }}.msi cx-freeze-zip: + if: ${{ false }} name: cx-Freeze zip uses: ./.github/workflows/job_cx-freeze-zip.yml with: @@ -94,11 +95,11 @@ jobs: cx-freeze-zip-release: needs: cx-freeze-zip name: cx-Freeze zip - uses: ./.github/workflows/job_release.yml + uses: ./.github/workflows/job_publish.yml with: version: ${{ github.ref_name }} - file1: Rare-Windows.zip - name1: Rare-Windows-${{ github.ref_name }}.zip + file1: Rare.zip + name1: Rare-portable-windows-${{ github.ref_name }}.zip macos: name: macOS @@ -108,7 +109,7 @@ jobs: macos-release: needs: macos name: macOS - uses: ./.github/workflows/job_release.yml + uses: ./.github/workflows/job_publish.yml with: version: ${{ github.ref_name }} file1: Rare.dmg diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 584e95e03..a568d1f6c 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -61,7 +61,7 @@ jobs: if: ${{ inputs.prerelease }} needs: [version, prerelease, ubuntu] name: Ubuntu - uses: ./.github/workflows/job_release.yml + uses: ./.github/workflows/job_publish.yml with: version: ${{ needs.version.outputs.version }} file1: Rare.deb @@ -77,7 +77,7 @@ jobs: if: ${{ inputs.prerelease }} needs: [version, prerelease, appimage] name: AppImage - uses: ./.github/workflows/job_release.yml + uses: ./.github/workflows/job_publish.yml with: version: ${{ needs.version.outputs.version }} file1: Rare.AppImage @@ -86,7 +86,7 @@ jobs: name2: Rare-${{ needs.version.outputs.version }}.AppImage.zsync nuitka-win: - if: ${{ false }} + if: ${{ true }} needs: version name: Nuitka Windows uses: ./.github/workflows/job_nuitka-win.yml @@ -96,11 +96,11 @@ jobs: if: ${{ inputs.prerelease }} needs: [version, prerelease, nuitka-win] name: Nuitka Windows - uses: ./.github/workflows/job_release.yml + uses: ./.github/workflows/job_publish.yml with: version: ${{ needs.version.outputs.version }} - file1: Rare-Windows.zip - name1: Rare-Windows-${{ needs.version.outputs.version }}.zip + file1: Rare.zip + name1: Rare-portable-windows-${{ needs.version.outputs.version }}.zip cx-freeze-msi: needs: version @@ -112,13 +112,14 @@ jobs: if: ${{ inputs.prerelease }} needs: [version, prerelease, cx-freeze-msi] name: cx-Freeze msi - uses: ./.github/workflows/job_release.yml + uses: ./.github/workflows/job_publish.yml with: version: ${{ needs.version.outputs.version }} file1: Rare.msi name1: Rare-${{ needs.version.outputs.version }}.msi cx-freeze-zip: + if: ${{ false }} needs: version name: cx-Freeze zip uses: ./.github/workflows/job_cx-freeze-zip.yml @@ -128,11 +129,11 @@ jobs: if: ${{ inputs.prerelease }} needs: [version, prerelease, cx-freeze-zip] name: cx-Freeze zip - uses: ./.github/workflows/job_release.yml + uses: ./.github/workflows/job_publish.yml with: version: ${{ needs.version.outputs.version }} - file1: Rare-Windows.zip - name1: Rare-Windows-${{ needs.version.outputs.version }}.zip + file1: Rare-portable-windows.zip + name1: Rare-portable-windows-${{ needs.version.outputs.version }}.zip macos: needs: version @@ -144,7 +145,7 @@ jobs: if: ${{ inputs.prerelease }} needs: [version, prerelease, macos] name: macOS - uses: ./.github/workflows/job_release.yml + uses: ./.github/workflows/job_publish.yml with: version: ${{ needs.version.outputs.version }} file1: Rare.dmg diff --git a/misc/nuitka_build.ps1 b/misc/nuitka_build.ps1 index f718c32cd..d704162e1 100644 --- a/misc/nuitka_build.ps1 +++ b/misc/nuitka_build.ps1 @@ -8,7 +8,6 @@ $nuitka_opts = @( '--standalone' '--enable-plugin=anti-bloat' '--enable-plugin=pyside6' - '--enable-plugin=pywebview' '--show-modules' '--show-anti-bloat-changes' '--follow-stdlib' @@ -24,7 +23,7 @@ $nuitka_opts = @( '--include-package=pypresence' '--include-package-data=qtawesome' '--include-data-dir=rare\resources\images\=rare\resources\images\' - '--include-data-files=rare\resources\languages\=rare\resources\languages\="rare_*.qm"' + '--include-data-files=rare\resources\languages\rare_*.qm=rare\resources\languages\' '--windows-icon-from-ico=rare\resources\images\Rare.ico' '--windows-company-name=RareDevs' '--windows-product-name=Rare' diff --git a/misc/nuitka_build.sh b/misc/nuitka_build.sh index 76004a64a..8fb02deec 100755 --- a/misc/nuitka_build.sh +++ b/misc/nuitka_build.sh @@ -24,7 +24,7 @@ nuitka_opts=( '--include-package=pypresence' '--include-package-data=qtawesome' '--include-data-dir=rare/resources/images/=rare/resources/images/' - '--include-data-files=rare/resources/languages/=rare/resources/languages/="rare_*.qm"' + '--include-data-files=rare/resources/languages/rare_*.qm=rare/resources/languages/' '--windows-icon-from-ico=rare/resources/images/Rare.ico' '--windows-company-name=RareDevs' '--windows-product-name=Rare' From 0270282d9bbad8fe4d2d96abbaa6e3ac9acee02d Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:04:21 +0300 Subject: [PATCH 4/5] workflows: enable nuitka builds for windows and macos --- .github/workflows/release.yml | 38 ++++++++++++++++++++++++++++---- .github/workflows/snapshot.yml | 40 +++++++++++++++++++++++++++++++--- 2 files changed, 71 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 91480e703..ee9bf3538 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,21 +57,51 @@ jobs: file2: Rare.AppImage.zsync name2: Rare-${{ github.ref_name }}.AppImage.zsync - nuitka-win: + nuitka-windows: if: ${{ true }} name: Nuitka Windows uses: ./.github/workflows/job_nuitka-win.yml with: version: ${{ github.ref_name }} - nuitka-win-release: - needs: nuitka-win + nuitka-windows-release: + needs: nuitka-windows name: Nuitka Windows uses: ./.github/workflows/job_publish.yml with: version: ${{ github.ref_name }} - file1: Rare-portable-windows.zip + file1: Rare.zip name1: Rare-portable-windows-${{ github.ref_name }}.zip + nuitka-linux: + if: ${{ true }} + name: Nuitka Linux + uses: ./.github/workflows/job_nuitka-linux.yml + with: + version: ${{ github.ref_name }} + nuitka-linux-release: + needs: nuitka-linux + name: Nuitka Linux + uses: ./.github/workflows/job_publish.yml + with: + version: ${{ github.ref_name }} + file1: Rare.zip + name1: Rare-portable-linux-${{ github.ref_name }}.zip + + nuitka-macos: + if: ${{ true }} + name: Nuitka MacOS + uses: ./.github/workflows/job_nuitka-macos.yml + with: + version: ${{ github.ref_name }} + nuitka-macos-release: + needs: nuitka-macos + name: Nuitka MacOS + uses: ./.github/workflows/job_publish.yml + with: + version: ${{ github.ref_name }} + file1: Rare.zip + name1: Rare-portable-macos-${{ github.ref_name }}.zip + cx-freeze-msi: name: cx-Freeze msi uses: ./.github/workflows/job_cx-freeze-msi.yml diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index a568d1f6c..b44579ad6 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -85,16 +85,16 @@ jobs: file2: Rare.AppImage.zsync name2: Rare-${{ needs.version.outputs.version }}.AppImage.zsync - nuitka-win: + nuitka-windows: if: ${{ true }} needs: version name: Nuitka Windows uses: ./.github/workflows/job_nuitka-win.yml with: version: ${{ needs.version.outputs.version }} - nuitka-win-release: + nuitka-windows-release: if: ${{ inputs.prerelease }} - needs: [version, prerelease, nuitka-win] + needs: [version, prerelease, nuitka-windows] name: Nuitka Windows uses: ./.github/workflows/job_publish.yml with: @@ -102,6 +102,40 @@ jobs: file1: Rare.zip name1: Rare-portable-windows-${{ needs.version.outputs.version }}.zip + nuitka-linux: + if: ${{ true }} + needs: version + name: Nuitka Linux + uses: ./.github/workflows/job_nuitka-linux.yml + with: + version: ${{ needs.version.outputs.version }} + nuitka-linux-release: + if: ${{ inputs.prerelease }} + needs: [version, prerelease, nuitka-linux] + name: Nuitka Linux + uses: ./.github/workflows/job_publish.yml + with: + version: ${{ needs.version.outputs.version }} + file1: Rare.zip + name1: Rare-portable-linux-${{ needs.version.outputs.version }}.zip + + nuitka-macos: + if: ${{ true }} + needs: version + name: Nuitka MacOS + uses: ./.github/workflows/job_nuitka-macos.yml + with: + version: ${{ needs.version.outputs.version }} + nuitka-macos-release: + if: ${{ inputs.prerelease }} + needs: [version, prerelease, nuitka-macos] + name: Nuitka MacOS + uses: ./.github/workflows/job_publish.yml + with: + version: ${{ needs.version.outputs.version }} + file1: Rare.zip + name1: Rare-portable-macos-${{ needs.version.outputs.version }}.zip + cx-freeze-msi: needs: version name: cx-Freeze msi From 829632faaee9c0c404f593eedf0b5f03f9b676dc Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:14:12 +0300 Subject: [PATCH 5/5] workflows: fix icon formats --- .github/workflows/job_nuitka-linux.yml | 3 +-- .github/workflows/job_nuitka-macos.yml | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/job_nuitka-linux.yml b/.github/workflows/job_nuitka-linux.yml index 175593ab5..12e112c69 100644 --- a/.github/workflows/job_nuitka-linux.yml +++ b/.github/workflows/job_nuitka-linux.yml @@ -29,7 +29,6 @@ jobs: run: >- python -m nuitka --assume-yes-for-downloads - --mingw64 --lto=no --jobs=4 --static-libpython=no @@ -52,7 +51,7 @@ jobs: --include-package-data=qtawesome --include-data-dir=rare/resources/images/=rare/resources/images/ --include-data-files=rare/resources/languages/rare_*.qm=rare/resources/languages/ - --windows-icon-from-ico=rare/resources/images/Rare.ico + --windows-icon-from-ico=rare/resources/images/Rare.png --windows-company-name=RareDevs --windows-product-name=Rare --windows-file-description=rare.exe diff --git a/.github/workflows/job_nuitka-macos.yml b/.github/workflows/job_nuitka-macos.yml index 9b70fedfe..c8112bebd 100644 --- a/.github/workflows/job_nuitka-macos.yml +++ b/.github/workflows/job_nuitka-macos.yml @@ -29,7 +29,7 @@ jobs: run: >- python -m nuitka --assume-yes-for-downloads - --mingw64 + --clang --lto=no --jobs=4 --static-libpython=no @@ -52,7 +52,7 @@ jobs: --include-package-data=qtawesome --include-data-dir=rare/resources/images/=rare/resources/images/ --include-data-files=rare/resources/languages/rare_*.qm=rare/resources/languages/ - --windows-icon-from-ico=rare/resources/images/Rare.ico + --windows-icon-from-ico=rare/resources/images/Rare.icns --windows-company-name=RareDevs --windows-product-name=Rare --windows-file-description=rare.exe