diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 62d3f03..5cbf0c2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -99,7 +99,7 @@ jobs: retention-days: 2 build-linux-artifacts: - name: build-linux + name: build-linux-generic runs-on: ubuntu-24.04 defaults: run: @@ -125,6 +125,13 @@ jobs: - name: Build release run: poetry run python scripts/build.py --os linux + - name: Install appimage-builder + run: pip install appimage-builder + + - name: Create AppImage file + uses: AppImageCrafters/build-appimage@master +# run: ./scripts/create-appimage.sh + - name: Rename artifact run: ./scripts/rename-release-file.sh linux @@ -136,7 +143,7 @@ jobs: retention-days: 2 publish-release: - needs: [ build-windows-artifacts, build-macos-artifacts ] + needs: [ build-windows-artifacts, build-macos-artifacts, build-linux-artifacts ] runs-on: ubuntu-latest environment: publish-release steps: diff --git a/.gitignore b/.gitignore index 83f601e..7ae0bf9 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,11 @@ packaging/upx-* # Versionfile **/versionfile.txt + +# Generated requirements.txt +**/requirements.txt + +# AppImage Builder +appimage-build/ +AppDir/ +**/*AppImage diff --git a/AppImageBuilder.yml b/AppImageBuilder.yml new file mode 100644 index 0000000..f365cd6 --- /dev/null +++ b/AppImageBuilder.yml @@ -0,0 +1,37 @@ +version: 1 +script: + - TARGET_APPDIR=./AppDir + - rm -rf $TARGET_APPDIR | true + - mkdir -p $TARGET_APPDIR/usr/src + - mkdir -p $TARGET_APPDIR/usr/share/icons + - cp -r ./dist/Doggo/* $TARGET_APPDIR/usr/src + - cp ./src/doggo/assets/icon-42.png $TARGET_APPDIR/usr/share/icons/doggo.png + +AppDir: + app_info: + id: org.u8slvn.doggo + name: Doggo + icon: doggo + version: 0.1.0 + exec: usr/src/Doggo + + test: + debian: + image: appimagecrafters/tests-env:debian-stable + command: "./AppRun" + centos: + image: appimagecrafters/tests-env:centos-7 + command: "./AppRun" + arch: + image: appimagecrafters/tests-env:archlinux-latest + command: "./AppRun" + fedora: + image: appimagecrafters/tests-env:fedora-30 + command: "./AppRun" + ubuntu: + image: appimagecrafters/tests-env:ubuntu-xenial + command: "./AppRun" + +AppImage: + arch: x86_64 + file_name: ./dist/Doggo.AppImage diff --git a/poetry.lock b/poetry.lock index efb4692..b17ef9d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -443,13 +443,13 @@ files = [ [[package]] name = "pefile" -version = "2023.2.7" +version = "2024.8.26" description = "Python PE parsing module" optional = false python-versions = ">=3.6.0" files = [ - {file = "pefile-2023.2.7-py3-none-any.whl", hash = "sha256:da185cd2af68c08a6cd4481f7325ed600a88f6a813bad9dea07ab3ef73d8d8d6"}, - {file = "pefile-2023.2.7.tar.gz", hash = "sha256:82e6114004b3d6911c77c3953e3838654b04511b8b66e8583db70c65998017dc"}, + {file = "pefile-2024.8.26-py3-none-any.whl", hash = "sha256:76f8b485dcd3b1bb8166f1128d395fa3d87af26360c2358fb75b80019b957c6f"}, + {file = "pefile-2024.8.26.tar.gz", hash = "sha256:3ff6c5d8b43e8c37bb6e6dd5085658d658a7a0bdcd20b6a07b1fcfc1c4e9d632"}, ] [[package]] @@ -867,19 +867,23 @@ files = [ [[package]] name = "setuptools" -version = "73.0.1" +version = "74.0.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-73.0.1-py3-none-any.whl", hash = "sha256:b208925fcb9f7af924ed2dc04708ea89791e24bde0d3020b27df0e116088b34e"}, - {file = "setuptools-73.0.1.tar.gz", hash = "sha256:d59a3e788ab7e012ab2c4baed1b376da6366883ee20d7a5fc426816e3d7b1193"}, + {file = "setuptools-74.0.0-py3-none-any.whl", hash = "sha256:0274581a0037b638b9fc1c6883cc71c0210865aaa76073f7882376b641b84e8f"}, + {file = "setuptools-74.0.0.tar.gz", hash = "sha256:a85e96b8be2b906f3e3e789adec6a9323abf79758ecfa3065bd740d81158b11e"}, ] [package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.5.2)"] core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.text (>=3.7)", "more-itertools (>=8.8)", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] +cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.11.*)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +type = ["importlib-metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.11.*)", "pytest-mypy"] [[package]] name = "six" diff --git a/scripts/build.py b/scripts/build.py index 3770a7a..9342d60 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -64,7 +64,7 @@ def build_pyinstaller_args( logger.info(f"Add data: {items};./{ASSETS_FOLDER}/{items.name}") build_args += ["--add-data", f"{items}:./{ASSETS_FOLDER}/{items.name}"] - if os in ["windows", "linux"]: + if os in ["windows"]: logger.info(f"Add splash image: {ASSETS_PATH.joinpath('splash.png')}") build_args += ["--splash", f"{ASSETS_PATH.joinpath('splash.png')}"] diff --git a/scripts/create-appimage.sh b/scripts/create-appimage.sh new file mode 100755 index 0000000..999db15 --- /dev/null +++ b/scripts/create-appimage.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +poetry export -f requirements.txt --output requirements.txt --without dev +appimage-builder --recipe AppImageBuilder.yml diff --git a/scripts/rename-release-file.sh b/scripts/rename-release-file.sh index 20a5166..4b7aca5 100755 --- a/scripts/rename-release-file.sh +++ b/scripts/rename-release-file.sh @@ -8,7 +8,7 @@ VERSION=$(poetry version --short) case "$OS_NAME" in "macos") ARCH_NAME=$([[ "$(arch)" = "arm64" ]] && echo "AppleSilicon" || echo "Intel") - FILE_NAME="doggo-${VERSION}-macos-${ARCH_NAME}.dmg" + FILE_NAME="doggo-${VERSION}-${ARCH_NAME}.dmg" mv ./dist/Doggo.dmg "./dist/$FILE_NAME" ;; "windows") @@ -23,7 +23,7 @@ case "$OS_NAME" in ;; "linux") ARCH_NAME=$(uname -m) - FILE_NAME="doggo-${VERSION}-linux-${ARCH_NAME}.AppImage" + FILE_NAME="doggo-${VERSION}-${ARCH_NAME}.AppImage" mv ./dist/Doggo.AppImage "./dist/$FILE_NAME" ;; *)