Skip to content

Build AppImage

Build AppImage #4

name: Build Test AppImage
on:
workflow_dispatch:
inputs:
commitHash:
description: 'Enter the commit hash to build (leave empty to use the default branch or the branch that triggered the workflow)'
required: false
type: string
buildDMG:
description: 'Test Build AppImage'
required: false
type: boolean
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags
ref: ${{ github.event.inputs.commitHash || github.sha }}
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup xvfb (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb \
libxkbcommon-x11-0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxcb-xinput0 \
libxcb-xfixes0 \
libxcb-shape0 \
libglib2.0-0 \
libgl1-mesa-dev \
'^libxcb.*-dev' \
libx11-xcb-dev \
libglu1-mesa-dev \
libxrender-dev \
libxi-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libsecp256k1-0
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Run build script
run: poetry run python tools/build.py --targets appimage --commit None
- name: Check for AppImage file
run: |
if [ -z "$(find dist -type f -name '*.AppImage')" ]; then
echo "AppImage file is missing"
exit 1
fi
- name: Upload AppImage Files from dist/
uses: actions/upload-artifact@v4
with:
name: appimages
path: dist/*.appimage
# - name: Install Dependencies for gui test
# run: |
# sudo apt-get update
# sudo apt-get install -y xvfb libfuse2 xdotool
# shell: bash
# - name: Start Xvfb
# run: Xvfb :99 -screen 0 1024x768x16 &
# env:
# DISPLAY: ":99"
# - name: Run AppImage
# run: |
# APPIMAGE=$(find ./dist -maxdepth 1 -name "*.AppImage" | head -n 1)
# if [ -z "$APPIMAGE" ]; then
# echo "No AppImage file found in ./dist/"
# exit 1
# fi
# echo "Running AppImage: $APPIMAGE"
# chmod +x "$APPIMAGE"
# "$APPIMAGE" &
# env:
# DISPLAY: ":99"
# - name: Wait for Application to Start
# run: sleep 5
# - name: Check for Application Window
# run: |
# WINDOW_NAME="Bitcoin Safe"
# WINDOW_ID=$(xdotool search --name "$WINDOW_NAME")
# if [ -z "$WINDOW_ID" ]; then
# echo "Application window not found."
# exit 1
# else
# echo "Application window found with ID: $WINDOW_ID"
# fi
# env:
# DISPLAY: ":99"
# - name: Close Application
# run: |
# xdotool search --name "Bitcoin Safe" windowkill %@ || true
# env:
# DISPLAY: ":99"