diff --git a/Makefile b/Makefile index be08000c49bf4623609eee8156b9ec53a2adcb0a..3443fce21a391c0aced778780d40e3b6400cc29e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ .PHONY: docs tests check check-format mypy pylint format build deploy deploy_test .SILENT: deploy deploy_test # do not echo commands with password +# bash required to use source command +SHELL := /bin/bash + # run tests tests: python3 gen_resources.py @@ -39,6 +42,11 @@ build: python3 setup.py sdist bdist_wheel twine check dist/* +appimage: + cd ci/appimage && wget -qc https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod u+x linuxdeploy-x86_64.AppImage + cd ci/appimage && wget -qc https://github.com/niess/linuxdeploy-plugin-python/releases/download/continuous/linuxdeploy-plugin-python-x86_64.AppImage && chmod u+x linuxdeploy-plugin-python-x86_64.AppImage + cd ci/appimage && source config.env && ./build.sh + # upload on PyPi repository deploy: twine upload dist/* --username ${PYPI_LOGIN} --password ${PYPI_PASSWORD} diff --git a/ci/appimage/build.sh b/ci/appimage/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..c6b6b9a92f593bf732dffcc2684f3298617f7ec8 --- /dev/null +++ b/ci/appimage/build.sh @@ -0,0 +1,2 @@ +#!/bin/bash +./linuxdeploy-x86_64.AppImage --appdir AppDir -i sakia.png -d sakia.desktop --plugin python --output appimage --custom-apprun sakia.sh diff --git a/ci/appimage/config.env b/ci/appimage/config.env new file mode 100644 index 0000000000000000000000000000000000000000..0282bc25bd0d7c943069bcb1db61e62973efe874 --- /dev/null +++ b/ci/appimage/config.env @@ -0,0 +1,9 @@ +version=0.53.0 + +# linuxdeploy python plugin +export PYTHON_SOURCE=https://www.python.org/ftp/python/3.6.10/Python-3.6.10.tgz +export PIP_REQUIREMENTS=$(pwd)/../../dist/sakia-${version}-py3-none-any.whl + +# linuxdeploy appimage plugin +export OUTPUT=Sakia_x86_64-${version}.AppImage + diff --git a/ci/appimage/sakia.desktop b/ci/appimage/sakia.desktop new file mode 100644 index 0000000000000000000000000000000000000000..bf8ca59f29ab458f66f5f34f5d362cfa362b6993 --- /dev/null +++ b/ci/appimage/sakia.desktop @@ -0,0 +1,17 @@ +[Desktop Entry] +Version=1.0 +Name=Sakia +Name[fr]=Sakia +Comment=Duniter Äž1 Libre Currency Client +Comment[fr]=Client pour la Monnaie Libre Duniter Äž1 +GenericName=Sakia client +GenericName[fr]=Client Sakia +Exec=sakia +Terminal=false +Type=Application +Icon=sakia +Categories=Utility; +StartupNotify=true +GenericName[fr_FR]=Client Sakia +Comment[fr_FR]=Client pour la Monnaie Libre Duniter Äž1 +MimeType=x-scheme-handler/duniter; diff --git a/ci/appimage/sakia.png b/ci/appimage/sakia.png new file mode 100644 index 0000000000000000000000000000000000000000..85ffb7ebd514aa6779cbfae8936670818e29da91 Binary files /dev/null and b/ci/appimage/sakia.png differ diff --git a/ci/appimage/sakia.sh b/ci/appimage/sakia.sh new file mode 100755 index 0000000000000000000000000000000000000000..aade04d554ab17e5a3dca15463aaa175ec52bc73 --- /dev/null +++ b/ci/appimage/sakia.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Export APPRUN if running from an extracted image +self="$(readlink -f -- $0)" +here="${self%/*}" +APPDIR="${APPDIR:-${here}}" + +# Call the entry point +${APPDIR}/usr/bin/python3.6 -s ${APPDIR}/usr/python/lib/python3.6/site-packages/sakia/main.py "$@" diff --git a/release.sh b/release.sh index 5525d026b07f7f4915a68215a6af77abdf9ed662..c93412c562ef8e60c4f7e34706f3521a9c644efd 100755 --- a/release.sh +++ b/release.sh @@ -10,7 +10,8 @@ if [[ $1 =~ ^[0-9]+.[0-9]+.[0-9]+[0-9A-Za-z]*$ ]]; then sed -i "s/#define MyAppVerStr .*/#define MyAppVerStr \"$1\"/g" ci/appveyor/sakia.iss sed -i "s/Version: .*/Version: $1/g" ci/travis/debian/DEBIAN/control sed -i "s/Version=.*/Version=$1/g" res/linux/usr/share/applications/sakia.desktop - git commit src/sakia/__init__.py ci/appveyor/sakia.iss ci/travis/debian/DEBIAN/control res/linux/usr/share/applications/sakia.desktop -m "$1" + sed -i "s/version=.*/version=$1/g" ci/appimage/config.env + git commit src/sakia/__init__.py ci/appveyor/sakia.iss ci/travis/debian/DEBIAN/control res/linux/usr/share/applications/sakia.desktop ci/appimage/config.env -m "$1" git tag "$1" -a -m "$1" else echo "Wrong version format"