Skip to content

Commit

Permalink
fix: AppImage build (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
yurijmikhalevich authored Dec 14, 2024
1 parent 043e646 commit 95cc6a5
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 22 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,28 @@ jobs:

appimage:
needs: [parse_tag, validate]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up APPDIR for after_bundle
run: echo "APPDIR=$PWD/AppDir" >> $GITHUB_ENV
- name: Build AppImage
uses: AppImageCrafters/[email protected]
- uses: actions/setup-python@v4
with:
recipe: './release-utils/appimage/appimage-builder.yml'
python-version: '3.10'
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install --upgrade poetry
- run: sudo apt-get install -y fuse
- name: Install appimage-builder
run: |
wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
chmod +x appimage-builder-x86_64.AppImage
sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder
- name: Build AppImage
env:
APP_VERSION: ${{ needs.parse_tag.outputs.version }}
run: poetry run appimage-builder --skip-tests --recipe ./release-utils/appimage/appimage-builder.yml
- name: Validate built AppImage
run: ./rclip*.AppImage cat
- name: Rename AppImage for GitHub releases page
run: mv rclip-${{ needs.parse_tag.outputs.version }}-x86_64.AppImage rclip-${{ needs.parse_tag.outputs.version }}-amd64.AppImage
- uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ cython_debug/
# AppImage
AppDir
appimage-builder-cache
appimage-build
*.AppImage
*.AppImage.zsync
requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "rclip"
version = "1.11.1a12"
version = "1.11.1a24"
description = "AI-Powered Command-Line Photo Search Tool"
authors = ["Yurij Mikhalevich <[email protected]>"]
license = "MIT"
Expand Down
23 changes: 12 additions & 11 deletions release-utils/appimage/appimage-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ script:
- cp rclip AppDir/usr/src -r
- cp release-utils/appimage/[email protected] AppDir/usr/share/icons/hicolor/256x256/apps/rclip.png


AppDir:
path: ./AppDir

Expand All @@ -22,30 +21,32 @@ AppDir:
# Set the python executable as entry point
exec: usr/bin/python3.10
# Set the application main script path as argument. Use '$@' to forward CLI parameters
exec_args: "${APPDIR}/usr/bin/rclip $@"
exec_args: "${APPDIR}/usr/local/bin/rclip $@"

apt:
arch: amd64
sources:
- sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse'
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
- sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal-updates main restricted'
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
- sourceline: 'deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal main'
- sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse'
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C'
- sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted'
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C'
- sourceline: 'deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu jammy main'
key_url: 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xba6932366a755776'

include:
- curl
- libffi7
- libpython3.10-minimal
- libpython3.10-stdlib
- python3.10
- python3.10-distutils
- python3.10-minimal
- python3-pip
- python3-distutils
exclude: []

after_bundle: >
PATH=${APPDIR}/usr/bin:${PATH} ./release-utils/appimage/appimage_after_bundle.sh
after_bundle: |
export APPDIR="$(pwd)/AppDir"
echo ${APPDIR}
PATH="${APPDIR}/usr/bin:${PATH}" ./release-utils/appimage/appimage_after_bundle.sh
runtime:
env:
Expand Down
4 changes: 2 additions & 2 deletions release-utils/appimage/appimage_after_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
set -e

PYTHONHOME=$APPDIR/usr \
PYTHONPATH=$APPDIR/usr/lib/python3.10/site-packages:$APPDIR/usr/lib/python3.10 \
PYTHONPATH=$APPDIR/usr/lib/python3/dist-packages:$APPDIR/usr/lib/python3.10 \
LD_LIBRARY_PATH=$APPDIR/usr/lib/x86_64-linux-gnu \
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 &&
which python3.10 &&
python3.10 -m pip install poetry==1.8.4 &&
python3.10 -m pip install --upgrade --isolated --no-input --ignore-installed --prefix="$APPDIR/usr" certifi setuptools wheel &&
python3.10 -m poetry build &&
Expand Down
4 changes: 2 additions & 2 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: |
For a detailed demonstration, watch the video: https://www.youtube.com/watch?v=tAJHXOkHidw.
You can use another image as a query by passing a file path or even an URL to the image file to **rclip** and combine multiple queries. Check out the project's README on GitHub for more usage examples: https://github.com/yurijmikhalevich/rclip#readme.
version: 1.11.1a12
version: 1.11.1a24
website: https://github.com/yurijmikhalevich/rclip
contact: [email protected]
passthrough:
Expand All @@ -28,7 +28,7 @@ apps:
parts:
rclip:
plugin: python
source: ./snap/local/rclip-1.11.1a12.tar.gz
source: ./snap/local/rclip-1.11.1a24.tar.gz
build-packages:
- python3-pip
build-environment:
Expand Down

0 comments on commit 95cc6a5

Please sign in to comment.