From 8e2212f0353fb96ba0f9f8de8514e0c9d037bbc4 Mon Sep 17 00:00:00 2001 From: Kareem <2+imrayya@noreply.localhost> Date: Wed, 1 Jul 2026 14:51:46 +0200 Subject: [PATCH] ci: fixed python path --- .gitea/workflows/build-exe.yml | 38 ++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/build-exe.yml b/.gitea/workflows/build-exe.yml index 0e7511d..0da79c4 100644 --- a/.gitea/workflows/build-exe.yml +++ b/.gitea/workflows/build-exe.yml @@ -18,7 +18,7 @@ env: WINEPYTHON: ${{ github.workspace }}/wine-prefix/drive_c/Python312/python.exe DISPLAY: :99.0 WINEDLLOVERRIDES: "mscoree,mshtml=;winemenubuilder.exe=d" - WINEARCH: win64 # ensure 64-bit prefix + WINEARCH: win64 jobs: build: @@ -51,22 +51,32 @@ jobs: wineboot --init --update winecfg -v win10 - - name: Download Python installer + - name: Download Python embeddable ZIP run: | wget -q \ - https://www.python.org/ftp/python/3.12.4/python-3.12.4-amd64.exe \ - -O /tmp/python.exe + "https://www.python.org/ftp/python/3.12.4/python-3.12.4-embed-amd64.zip" \ + -O /tmp/python-embed.zip - - name: Install Python in Wine + - name: Extract Python into Wine prefix run: | - # Removed InstallAllUsers=1 → installs to C:\Python312 (matches WINEPYTHON) - wine /tmp/python.exe /quiet PrependPath=1 Include_test=0 - rm /tmp/python.exe - # Verify the installation - echo "Contents of C:\\Python312:" - ls -la "$WINEPREFIX/drive_c/Python312" || echo "Python folder missing!" - echo "Checking python.exe:" - ls -la "$WINEPREFIX/drive_c/Python312/python.exe" || echo "python.exe missing!" + TARGET="$WINEPREFIX/drive_c/Python312" + mkdir -p "$TARGET" + unzip -q /tmp/python-embed.zip -d "$TARGET" + # Remove the embeddable zip to avoid confusion + rm /tmp/python-embed.zip + # Verify + echo "Python executable:" + ls -la "$TARGET/python.exe" + + - name: Bootstrap pip for embedded Python + run: | + cd "$WINEPREFIX/drive_c/Python312" + # Download get-pip.py + wget -q https://bootstrap.pypa.io/get-pip.py + wine python.exe get-pip.py --no-warn-script-location + rm get-pip.py + # Verify pip is installed + wine python.exe -m pip --version - name: Install Python dependencies run: | @@ -108,6 +118,7 @@ jobs: RELEASE_TAG: rolling-draft run: | API="${{ github.api_url }}/repos/${{ github.repository }}" + RESPONSE=$(curl -sS -H "Authorization: token $GITEA_TOKEN" \ "$API/releases/tags/$RELEASE_TAG") RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id // empty') @@ -122,6 +133,7 @@ jobs: "body": "Latest PaperDash server build from commit '"${{ github.sha }}"'. Built on Linux via Wine + PyInstaller. Edit tag, name, and notes before publishing." }' \ "$API/releases/$RELEASE_ID" + ASSETS=$(curl -sS -H "Authorization: token $GITEA_TOKEN" \ "$API/releases/$RELEASE_ID/assets") for asset_id in $(echo "$ASSETS" | jq -r '.[].id'); do