Skip to content

Commit

Permalink
build: add appimage builder
Browse files Browse the repository at this point in the history
  • Loading branch information
u8slvn committed Aug 29, 2024
1 parent 3ee8e46 commit 4248c25
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 11 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -125,6 +125,12 @@ 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
run: ./scripts/create-appimage.sh

- name: Rename artifact
run: ./scripts/rename-release-file.sh linux

Expand All @@ -136,7 +142,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:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,9 @@ packaging/upx-*

# Versionfile
**/versionfile.txt

# Generated requirements.txt
**/requirements.txt

# AppImage Builder
appimage-build/
49 changes: 49 additions & 0 deletions AppImageBuilder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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 ./src/* $TARGET_APPDIR/usr/src
- cp ./src/doggo/assets/icon-42.png $TARGET_APPDIR/usr/share/icons/doggo.png
- python --version
- python -m pip install --ignore-installed --prefix=/usr --root=$TARGET_APPDIR -r ./requirements.txt

AppDir:
app_info:
id: org.u8slvn.doggo
name: Doggo
icon: doggo
version: 0.1.0
exec: python
exec_args: "$APPDIR/usr/src/doggo/__main__.py"

apt:
arch: amd64
sources:
- sourceline: deb [arch=amd64] [trusted=yes] http://archive.ubuntu.com/ubuntu/ noble main restricted universe multiverse
- sourceline: deb [arch=amd64] [trusted=yes] http://archive.ubuntu.com/ubuntu/ noble-updates main restricted universe multiverse

include:
- python
- coreutils

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
18 changes: 11 additions & 7 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions scripts/create-appimage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

poetry export -f requirements.txt --output requirements.txt --without dev
appimage-builder --recipe AppImageBuilder.yml
4 changes: 2 additions & 2 deletions scripts/rename-release-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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"
;;
*)
Expand Down

0 comments on commit 4248c25

Please sign in to comment.