From 9c32dfbf7a756b27d7a8ea66eee43ee68da571b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Deuchnord?= Date: Tue, 28 Dec 2021 13:13:57 +0100 Subject: [PATCH] build: generate AppImage file --- .github/workflows/appimage.yml | 42 ++++++++++++++++++++++ .gitignore | 6 ++++ AppImageBuilder.yml | 66 ++++++++++++++++++++++++++++++++++ Makefile | 11 ++++-- _kosmorro/locales/messages.pot | 6 ++-- 5 files changed, 126 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/appimage.yml create mode 100644 AppImageBuilder.yml diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml new file mode 100644 index 0000000..afcbb8b --- /dev/null +++ b/.github/workflows/appimage.yml @@ -0,0 +1,42 @@ +name: AppImage + +on: + pull_request: + branches: [master, features] + release: + +jobs: + build-appimage: + name: Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Prepare environment + run: | + sudo gem install ronn + wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool + sudo chmod +x /usr/local/bin/appimagetool + pip install -U pip pipenv Babel wheel appimage-builder + pipenv install --dev + + - name: Build wheel + run: | + make i18n build + + - name: Build AppImage + run: | + make appimage + + - name: Upload AppImage + uses: actions/upload-artifact@v2 + with: + name: kosmorro.AppImage + path: dist/kosmorro-latest-x86_64.AppImage + + - name: Upload AppImage version synchronization file + uses: actions/upload-artifact@v2 + with: + name: kosmorro.AppImage.zsync + path: dist/kosmorro-latest-x86_64.AppImage.zsync diff --git a/.gitignore b/.gitignore index 3ef7233..9c6b0c6 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,9 @@ coverage.xml # GitPod-specific: /.vscode/** + +# AppImage builds +/AppDir +/appimage-builder-cache +*.AppImage +*.AppImage.zsync diff --git a/AppImageBuilder.yml b/AppImageBuilder.yml new file mode 100644 index 0000000..05fbe3c --- /dev/null +++ b/AppImageBuilder.yml @@ -0,0 +1,66 @@ +# appimage-builder recipe see https://appimage-builder.readthedocs.io for details +version: 1 + +script: | + mkdir -p build/AppDir build/AppDir/usr/share/icons/hicolor/scalable/apps + cp _kosmorro/assets/svg/kosmorro-icon.svg build/AppDir/usr/share/icons/hicolor/scalable/apps/kosmorro.svg + pip3 install --isolated --root="./build/AppDir" ./dist/kosmorro-*.whl + +AppDir: + path: build/AppDir + app_info: + id: space.kosmorro.cli + name: kosmorro + icon: kosmorro + version: latest + exec: usr/bin/python3 + exec_args: $APPDIR/usr/local/bin/kosmorro $@ + + apt: + arch: amd64 + allow_unauthenticated: true + sources: + - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal main restricted + - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal universe restricted + include: + - python3 + - python3-certifi + - python3-dateutil + + files: + include: + - /usr/bin/sh + - /usr/bin/bash + - /usr/bin/env + exclude: + - usr/share/man + - usr/share/doc/*/README.* + - usr/share/doc/*/changelog.* + - usr/share/doc/*/NEWS.* + - usr/share/doc/*/TODO.* + + test: + fedora-30: + image: appimagecrafters/tests-env:fedora-33 + command: ./AppRun --latitude=50.5824 --longitude=3.0624 + use_host_x: true + debian-stable: + image: appimagecrafters/tests-env:debian-stable + command: ./AppRun --latitude=50.5824 --longitude=3.0624 + use_host_x: true + archlinux-latest: + image: appimagecrafters/tests-env:archlinux-latest + command: ./AppRun --latitude=50.5824 --longitude=3.0624 + use_host_x: true + centos-7: + image: appimagecrafters/tests-env:centos-7 + command: ./AppRun --latitude=50.5824 --longitude=3.0624 + use_host_x: true + ubuntu-xenial: + image: appimagecrafters/tests-env:ubuntu-xenial + command: ./AppRun --latitude=50.5824 --longitude=3.0624 + use_host_x: true + +AppImage: + arch: x86_64 + update-information: gh-releases-zsync|Kosmorro|kosmorro|latest|Kosmorro-*x86_64.AppImage.zsync diff --git a/Makefile b/Makefile index 19d78be..c64a83e 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ messages: pipenv run python setup.py extract_messages --output-file=_kosmorro/locales/messages.pot i18n: - python3 setup.py compile_catalog + pipenv run python setup.py compile_catalog changelog: conventional-changelog -p angular -i CHANGELOG.md -s @@ -23,5 +23,12 @@ prepare-release: messages changelog @echo @echo "Before tagging, don't forget to update version number in CHANGELOG" +appdir: + appimage-builder --skip-tests + mv *.AppImage dist/ + mv *.zsync dist/ + +appimage: appdir + clean: - rm -rf build dist kosmorro.egg-info manpage/kosmorro.{1,7}{,.html} + rm -rf build dist appimage-builder-cache kosmorro.egg-info manpage/kosmorro.{1,7}{,.html} diff --git a/_kosmorro/locales/messages.pot b/_kosmorro/locales/messages.pot index 61d0e2f..ee00c7c 100644 --- a/_kosmorro/locales/messages.pot +++ b/_kosmorro/locales/messages.pot @@ -1,14 +1,14 @@ # Translations template for kosmorro. -# Copyright (C) 2021 ORGANIZATION +# Copyright (C) 2022 ORGANIZATION # This file is distributed under the same license as the kosmorro project. -# FIRST AUTHOR , 2021. +# FIRST AUTHOR , 2022. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: kosmorro 0.10.7\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2021-12-30 12:15+0100\n" +"POT-Creation-Date: 2022-01-02 13:20+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n"