Add support for building an AppImage

Signed-off-by: Dan Yeaw <dan@yeaw.me>
This commit is contained in:
Dan Yeaw 2020-12-28 22:15:17 -05:00
parent 99ab989b7c
commit 56dba4dedb
No known key found for this signature in database
GPG Key ID: 42239C515C9B9841
9 changed files with 148 additions and 3 deletions

View File

@ -52,14 +52,14 @@ jobs:
run: make install
- name: Test with Pytest
run: xvfb-run make test-all
- name: Create Source Dist and Wheel
run: make dist
- name: Upload Code Coverage to Code Climate
uses: paambaati/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: 05f6288b94a87daa172d3e96a33ec331a4374be7d01eb9a42b3b21c4c550a8ff
with:
coverageCommand: poetry run coverage xml
- name: Create Source Dist and Wheel
run: make dist
- name: Upload gaphor-${{ steps.meta.outputs.version }}.tar.gz
uses: actions/upload-artifact@v2
with:
@ -70,6 +70,20 @@ jobs:
with:
name: gaphor-${{ steps.meta.outputs.version }}-py3-none-any.whl
path: dist/gaphor-${{ steps.meta.outputs.version }}-py3-none-any.whl
- name: Install AppImage Dependencies
run: |
cd appimage
make dep
- name: Build AppImage
run: |
cd appimage
make all
mv Gaphor-x86_64.AppImage ../dist/gaphor-${{ steps.meta.outputs.version }}.AppImage
- name: Upload gaphor-${{ steps.meta.outputs.version }}.AppImage
uses: actions/upload-artifact@v2
with:
name: gaphor-${{ steps.meta.outputs.version }}.AppImage
path: dist/gaphor-${{ steps.meta.outputs.version }}.AppImage
- name: Publish to PyPI (release only)
if: github.event_name == 'release'
run: poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}

View File

@ -4,6 +4,7 @@ Although we strive to make releases as automated as possible, there are a few st
All of the items in the draft release should be under the Features, Bug Fixes, or Maintenance headings.
- [ ] Test the previous build packages in Windows and macOS to ensure they launch successfully.
- [ ] Bump the version by updating it in the `pyproject.toml` file or by running `poetry version X.X.X`.
- [ ] Bump the AppImage version by running `cd appimage`, `make update VERSION=a.b.c`
- [ ] Go to the release, click on edit draft. Add a summary to the title in the draft release.
- [ ] In the draft release, update the version tag to the correct version (remove the v in front). Click on Publish Release.
- [ ] Wait for the build to finish and the release artifacts to be uploaded. The PyPI release is made automatically during

44
appimage/Makefile Normal file
View File

@ -0,0 +1,44 @@
#
# To update the version, run:
#
# make update VERSION=a.b.c
#
ID := Gaphor-x86_64
# Do not change version by hand!
VERSION := 2.1.1
DIST := dist
all: dist
dist: requirements.txt $(ID).AppImage
dep:
pip install python_appimage
update: clean version appdata requirements.txt
$(MAKE) clean all
version:
sed -i "s/^VERSION .*/VERSION := ${VERSION}/" Makefile
appdata:
sed -i '/ <releases>/a \ \ \ \ <release version="$(VERSION)" date="$(shell date +%Y-%m-%d)"/>' share/org.gaphor.Gaphor.appdata.xml
requirements.txt:
poetry export --without-hashes -o ${CURDIR}/requirements.txt
sed -i -r 's/(^.+);.*/\1/g' requirements.txt
echo 'gaphor==${VERSION}' >> requirements.txt
$(ID).AppImage:
python-appimage build app $(CURDIR)
clean:
rm -f requirements.txt
rm -f $(ID).AppImage
# for local testing:
run: $(ID).AppImage
./$(ID).AppImage

2
appimage/entrypoint.sh Normal file
View File

@ -0,0 +1,2 @@
#! /bin/bash -i
{{ python-executable }} -u "${APPDIR}/opt/python{{ python-version }}/bin/gaphor" "$@"

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" ?>
<component type="desktop-application">
<id>org.gaphor.Gaphor</id>
<launchable type="desktop-id">org.gaphor.Gaphor.desktop</launchable>
<name>Gaphor</name>
<summary>Simple modeling tool</summary>
<metadata_license>CC-BY-3.0</metadata_license>
<project_license>Apache-2.0</project_license>
<developer_name>Arjan J. Molenaar</developer_name>
<categories>
<category>Development</category>
<category>Graphics</category>
</categories>
<screenshots>
<screenshot type="default">
<caption>The Gaphor main window</caption>
<image type="source">
https://upload.wikimedia.org/wikipedia/commons/2/2e/Gaphor_2.0.0_Screenshot.png</image>
</screenshot>
</screenshots>
<url type="homepage">https://github.com/gaphor/gaphor</url>
<url type="help">https://gaphor.readthedocs.io</url>
<description>
<p>Gaphor is a simple modeling tool written in Python. It is Free and Open Source software
for creating software and system architecture and designs. It is aimed at beginning modelers.
</p>
</description>
<releases>
<release version="2.1.1" date="2020-11-30"/>
<release version="2.1.0" date="2020-11-29"/>
<release version="2.0.1" date="2020-08-27"/>
<release version="2.0.0" date="2020-07-31"/>
<release version="1.2.0" date="2020-03-15" />
<release version="1.1.1" date="2019-11-02" />
<release version="1.1.0" date="2019-10-26" />
<release version="1.0.2" date="2019-07-26" />
<release version="1.0.1" date="2019-04-19" />
<release version="1.0.0" date="2019-04-04" />
<release version="0.17.2" date="2013-07-05" />
</releases>
<content_rating type="oars-1.1" />
<update_contact>dan@yeaw.me</update_contact>
</component>

View File

@ -0,0 +1,11 @@
[Desktop Entry]
Name=Gaphor
Comment=The simple modeling tool
Comment[nl]=De eenvoudige modelleertool
Comment[pl]=Proste narzędzie do modelowania
Exec=gaphor %f
Icon=org.gaphor.Gaphor
Terminal=false
Type=Application
Categories=GTK;GNOME;Development;ProjectManagement;
MimeType=application/x-gaphor

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

10
appimage/requirements.txt Normal file
View File

@ -0,0 +1,10 @@
gaphas==3.0.0b3
generic==1.0.0
importlib-metadata==3.3.0
pycairo==1.20.0
pygobject==3.38.0
tinycss2==1.1.0
typing-extensions==3.7.4.3
webencodings==0.5.1
zipp==3.4.0
gaphor==2.1.1

View File

@ -56,7 +56,7 @@ repository](https://github.com/flathub/org.gaphor.Gaphor).
1. Install the GNOME SDK
$ flatpak install flathub org.gnome.Sdk 3.34
$ flatpak install flathub org.gnome.Sdk 3.38
1. Clone the Flathub repository and install the necessary SDK:
@ -72,6 +72,26 @@ repository](https://github.com/flathub/org.gaphor.Gaphor).
$ make install
## Create an AppImage Package
[AppImage](https://appimage.org/) is a format for distributing portable software
on Linux without needing superuser permissions to install the application. The
AppImage file is one executable which contains both Gaphor and Python. It allows
Gaphor to be run on any AppImage supported Linux distribution without
installation or root access.
The best way to build a Gaphor AppImage is using python-appimage:
1. `cd appimage`
1. `make update VERSION=x.x.x`
1. Activate your virtualenv, then run `make dep` to install python_appimage with pip
1. Build the AppImage by running `make all`
1. Test that Gaphor-x86_64.AppImage works by running `make run`
## Linux Distribution Packages
Examples of Gaphor and Gaphas RPM spec files can be found in [PLD