Skip to content

Commit 920cf3d

Browse files
committed
Merge branch '7-bug-antialiasing-key-issue-for-fedora-39-and-ubuntu-2204' into main
2 parents 6b20340 + d82eb54 commit 920cf3d

File tree

1 file changed

+86
-30
lines changed

1 file changed

+86
-30
lines changed

.github/workflows/release.yml

Lines changed: 86 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1+
# .github/workflows/release.yml
2+
13
name: Build and Release AppImage
24

35
on:
46
push:
57
tags:
68
- 'v*' # Trigger on tags like v0.1.0, v1.0.0 etc.
9+
# Allow manual triggering for testing
10+
workflow_dispatch:
711

812
permissions:
913
contents: write # Required to create releases and upload assets
1014

1115
jobs:
1216
build-release:
13-
name: Build and Release ChromaDesk AppImage
14-
# Use an older LTS release for better GLIBC compatibility.
15-
runs-on: ubuntu-20.04
17+
name: Build and Release ChromaDesk AppImage (on Ubuntu 22.04)
18+
19+
# --- THIS IS THE MODIFIED LINE ---
20+
# Specifies that this job should run on an Ubuntu 22.04 runner provided by GitHub Actions.
21+
runs-on: ubuntu-22.04
22+
# --- END OF MODIFIED LINE ---
1623

1724
steps:
1825
- name: Checkout code
@@ -21,19 +28,20 @@ jobs:
2128
- name: Set up Python
2229
uses: actions/setup-python@v5
2330
with:
24-
python-version: '3.11' # Specify your project's Python version if different
31+
python-version: '3.11' # Or your project's specific version
2532

2633
- name: Install System Build Dependencies
2734
run: |
2835
sudo apt-get update
36+
# libfuse2 is often needed for AppImage creation/compatibility tools
2937
sudo apt-get install -y --no-install-recommends \
3038
patchelf \
3139
desktop-file-utils \
3240
libfuse2 \
3341
fakeroot \
3442
libdbus-1-dev \
35-
pkg-config # Ensure pkg-config is installed
36-
# appimagetool is not in standard repos, download manually
43+
pkg-config
44+
# appimagetool will be downloaded manually
3745
3846
- name: Download and Install appimagetool
3947
run: |
@@ -44,64 +52,112 @@ jobs:
4452
sudo mv appimagetool.AppImage /usr/local/bin/appimagetool
4553
echo "appimagetool installed to /usr/local/bin/appimagetool"
4654
47-
- name: Get Project Version from pyproject.toml
55+
- name: Get Project Version
4856
id: get_project_version
4957
run: |
50-
# --- Check which version key exists in pyproject.toml ---
51-
# Assuming standard [project] table or [tool.poetry]
58+
# Robust version reading from pyproject.toml (supports project/poetry tables and Python 3.11+ tomllib or older tomli)
5259
VERSION_CMD=""
53-
if python -c "import tomllib; data=tomllib.load(open('pyproject.toml', 'rb')); exit(0) if 'project' in data and 'version' in data['project'] else exit(1)"; then
54-
VERSION_CMD="import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])"
55-
echo "Reading version from [project][version]"
56-
elif python -c "import tomllib; data=tomllib.load(open('pyproject.toml', 'rb')); exit(0) if 'tool' in data and 'poetry' in data['tool'] and 'version' in data['tool']['poetry'] else exit(1)"; then
57-
VERSION_CMD="import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['tool']['poetry']['version'])"
58-
echo "Reading version from [tool][poetry][version]"
60+
if python -c "import sys; sys.exit(0) if sys.version_info >= (3, 11) else sys.exit(1)"; then
61+
# Python 3.11+ has built-in tomllib
62+
if python -c "import tomllib; data=tomllib.load(open('pyproject.toml', 'rb')); exit(0) if 'project' in data and 'version' in data['project'] else exit(1)"; then
63+
VERSION_CMD="import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])"
64+
echo "Reading version from [project][version] using tomllib"
65+
elif python -c "import tomllib; data=tomllib.load(open('pyproject.toml', 'rb')); exit(0) if 'tool' in data and 'poetry' in data['tool'] and 'version' in data['tool']['poetry'] else exit(1)"; then
66+
VERSION_CMD="import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['tool']['poetry']['version'])"
67+
echo "Reading version from [tool][poetry][version] using tomllib"
68+
else
69+
echo "ERROR: Could not find project or tool.poetry version in pyproject.toml (Python 3.11+)"
70+
cat pyproject.toml # Print file content for debugging
71+
exit 1
72+
fi
5973
else
60-
echo "ERROR: Could not find [project][version] or [tool][poetry][version] in pyproject.toml"
61-
exit 1
74+
# Older Python, try tomli (install if necessary)
75+
pip install tomli
76+
if python -c "import tomli; data=tomli.load(open('pyproject.toml', 'rb')); exit(0) if 'project' in data and 'version' in data['project'] else exit(1)"; then
77+
VERSION_CMD="import tomli; print(tomli.load(open('pyproject.toml', 'rb'))['project']['version'])"
78+
echo "Reading version from [project][version] using tomli"
79+
elif python -c "import tomli; data=tomli.load(open('pyproject.toml', 'rb')); exit(0) if 'tool' in data and 'poetry' in data['tool'] and 'version' in data['tool']['poetry'] else exit(1)"; then
80+
VERSION_CMD="import tomli; print(tomli.load(open('pyproject.toml', 'rb'))['tool']['poetry']['version'])"
81+
echo "Reading version from [tool][poetry][version] using tomli"
82+
else
83+
echo "ERROR: Could not find project or tool.poetry version in pyproject.toml (tomli)"
84+
cat pyproject.toml # Print file content for debugging
85+
exit 1
86+
fi
6287
fi
63-
88+
6489
PROJECT_VERSION=$(python -c "${VERSION_CMD}")
90+
if [ -z "$PROJECT_VERSION" ]; then
91+
echo "ERROR: Failed to extract project version."
92+
exit 1
93+
fi
6594
echo "project_version=${PROJECT_VERSION}" >> $GITHUB_OUTPUT
6695
echo "Project version found: ${PROJECT_VERSION}"
67-
# --- End version check ---
96+
6897
6998
- name: Install Python Build Dependencies & Project
7099
run: |
71100
python -m pip install --upgrade pip
72101
# Install build tools
73-
pip install build setuptools wheel
74-
# Install project and its dependencies
75-
pip install . # Installs dependencies from pyproject.toml
102+
pip install build setuptools wheel
103+
# Explicitly install/upgrade PySide6 first (pinning to ensure latest known stable)
104+
echo "Installing/Upgrading PySide6..."
105+
pip install --upgrade "PySide6==6.8.3" # Pin to the confirmed latest stable version
106+
echo "Verifying PySide6 installation..."
107+
pip show PySide6 # Display installed version for confirmation
108+
echo "Installing project and its dependencies..."
109+
# Install project and its core dependencies (will use the pinned PySide6)
110+
pip install .
111+
# Install optional dependencies if needed by build.sh or runtime
112+
echo "Installing optional dependencies [notifications]..."
113+
pip install ".[notifications]"
114+
76115
77116
- name: Build AppImage using build.sh
78117
run: |
118+
# Ensure build.sh is executable
79119
chmod +x ./build.sh
120+
# Run the build script, telling it to create the AppImage
121+
# Use --debug flag on build.sh if more verbose output is needed from the script itself
80122
./build.sh --appimage
81123
82124
- name: Determine AppImage Filename
83125
id: get_appimage_filename
84126
run: |
85-
# VERSION="${{ github.ref_name }}" # Get tag like v0.2.0
86-
# VERSION="${VERSION#v}" # Remove leading 'v' -> 0.2.0
87-
VERSION="${{ steps.get_project_version.outputs.project_version }}" # Use version from pyproject.toml
127+
# Use the version obtained from pyproject.toml earlier
128+
VERSION="${{ steps.get_project_version.outputs.project_version }}"
129+
# Ensure VERSION is not empty
130+
if [ -z "$VERSION" ]; then
131+
echo "ERROR: Project version is empty. Cannot determine filename."
132+
exit 1
133+
fi
88134
FILENAME="chromadesk-${VERSION}-x86_64.AppImage"
89135
echo "filename=${FILENAME}" >> $GITHUB_OUTPUT
90-
echo "Checking for file: ${FILENAME} (using version ${VERSION} from project file)"
136+
echo "Checking for expected file: ${FILENAME}"
137+
# Verify the file was actually created by build.sh in the root directory
91138
if [[ ! -f "${FILENAME}" ]]; then
92-
echo "ERROR: Expected AppImage file ${FILENAME} not found!"
139+
echo "ERROR: Expected AppImage file ${FILENAME} not found in root after build!"
140+
echo "Listing current directory contents:"
141+
ls -lAh .
142+
echo "Listing .AppImage files found:"
93143
ls -l *.AppImage # List found AppImages for debugging
94144
exit 1
95145
fi
146+
echo "AppImage file ${FILENAME} found."
96147
97148
- name: Create GitHub Release and Upload Asset
98149
uses: softprops/action-gh-release@v2
99150
with:
151+
# Use the dynamically determined filename
100152
files: ${{ steps.get_appimage_filename.outputs.filename }}
101153
tag_name: ${{ github.ref_name }} # Use the tag that triggered workflow
102-
name: Release ${{ github.ref_name }}
103-
body: "Automated AppImage release for ChromaDesk ${{ github.ref_name }}"
154+
# Add a note about the build environment to the release title
155+
name: Release ${{ github.ref_name }} (Built on Ubuntu 22.04)
156+
body: | # Use multi-line body for clarity
157+
Automated AppImage release for ChromaDesk ${{ github.ref_name }}.
158+
159+
**Important Note:** This build was created on **Ubuntu 22.04**. It requires a newer GLIBC version (likely 2.35 or higher) and may **not** run on older Linux distributions like Ubuntu 20.04 or Debian 11.
104160
draft: false
105161
prerelease: false # Set to true if these are pre-releases
106162
env:
107-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Provided by GitHub Actions
163+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Provided by GitHub Actions

0 commit comments

Comments
 (0)