Skip to content

Fix AppImage build (#1073) #2021

Fix AppImage build (#1073)

Fix AppImage build (#1073) #2021

Workflow file for this run

name: general
on:
push:
branches:
- main
tags:
- v*.*.*
pull_request:
branches:
- main
env:
# Mandatory when using uv pip workflow.
UV_SYSTEM_PYTHON: 1
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.9.9"
- name: Set up Python 3.13
uses: actions/setup-python@v3
with:
python-version: "3.13"
- name: Check pep8
run: |
uvx ruff check
tests:
needs: lint
runs-on: ubuntu-latest
env:
QT_QPA_PLATFORM: 'offscreen'
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.9.9"
- name: Set up Python 3.13
uses: actions/setup-python@v3
with:
python-version: "3.13"
- name: Install QT Libs and Dependencies
uses: tlambert03/setup-qt-libs@v1
- name: Install python requirements
run: |
uv sync
- name: Check pep8
run: |
uvx ruff check
- name: Run tests
run: |
uv run pytest
macos-packaging:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
needs: tests
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.9.9"
- name: Set up Python 3.13
uses: actions/setup-python@v3
with:
python-version: "3.13"
- name: Install Dependencies
run: |
uv sync
brew install create-dmg
- name: Build and notarize the dmg file
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
run: |
chmod +x create-dmg.sh
./create-dmg.sh
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: distribution-files-macos
path: |
*.dmg
retention-days: 14
linux-packaging:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
needs: tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.9.9"
- name: Set up Python 3.13
uses: actions/setup-python@v3
with:
python-version: "3.13"
- name: Install OS Dependencies
run: |
sudo apt-get update
sudo gem install fpm
fpm --version
- name: Install Qt Dependencies
run: |
# https://forum.qt.io/post/769050
# Fix PyInstaller warnings of Qt Dependencies missing
sudo apt-get install synaptic
sudo apt-get install libxcb-icccm4 libxcb-image0-dev libxcb-keysyms1 libxcb-render-util0 libxcb-xkb1 libxcb-xinerama0 libxkbcommon-x11-0 libxcb-cursor0 libxcb-shape0-dev
- name: Install Dependencies
run: |
uv sync
- name: Build the deb package
run: |
chmod +x create-deb.sh
./create-deb.sh
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: distribution-files-deb
path: |
dist/*.deb
retention-days: 14
windows-packaging:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
needs: tests
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.9.9"
- name: Set up Python 3.13
uses: actions/setup-python@v3
with:
python-version: "3.13"
- name: Install Dependencies
run: |
uv sync
- name: Install NSIS
run: choco install nsis
- name: Build with PyInstaller
run: uv run build.py build
- name: Compile installer
shell: bash # Force bash shell for VERSION command
run: |
VERSION=$(uv run python -c "import ode; print(ode.__version__)")
makensis -DAPP_VERSION="$VERSION" ./packaging/windows/installer.nsi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: distribution-files-win
path: |
.\packaging\windows\*.exe
retention-days: 14
linux-app-image:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
needs: tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.9.9"
- name: Set up Python 3.13
uses: actions/setup-python@v3
with:
python-version: "3.13"
- name: Install Qt Dependencies
run: |
# https://forum.qt.io/post/769050
# Fix PyInstaller warnings of Qt Dependencies missing
sudo apt-get update
sudo apt-get install synaptic
sudo apt-get install libxcb-icccm4 libxcb-image0-dev libxcb-keysyms1 libxcb-render-util0 libxcb-xkb1 libxcb-xinerama0 libxkbcommon-x11-0
- name: Install Dependencies
run: |
uv sync
- name: Build the deb package
run: |
VERSION=$(uv run python -c "import ode; print(ode.__version__)")
uv run build.py build --onefile --name "opendataeditor-$VERSION.AppImage"
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: distribution-files-app-image
path: |
dist/*.AppImage
retention-days: 14