ci: fixed wine so hopefully it works and build the exe
Build Server .exe / build (push) Failing after 6m49s
Build Server .exe / build (push) Failing after 6m49s
This commit is contained in:
@@ -16,6 +16,7 @@ on:
|
|||||||
env:
|
env:
|
||||||
WINEPREFIX: ${{ github.workspace }}/wine-prefix
|
WINEPREFIX: ${{ github.workspace }}/wine-prefix
|
||||||
WINEPYTHON: ${{ github.workspace }}/wine-prefix/drive_c/Python312/python.exe
|
WINEPYTHON: ${{ github.workspace }}/wine-prefix/drive_c/Python312/python.exe
|
||||||
|
XDG_RUNTIME_DIR: /tmp # Suppress harmless warning
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -25,23 +26,22 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Wine
|
- name: Install Wine & xvfb
|
||||||
run: |
|
run: |
|
||||||
sudo dpkg --add-architecture i386
|
sudo dpkg --add-architecture i386
|
||||||
sudo mkdir -p /etc/apt/keyrings
|
sudo mkdir -p /etc/apt/keyrings
|
||||||
sudo wget -qO /etc/apt/keyrings/winehq-archive.key \
|
sudo wget -qO /etc/apt/keyrings/winehq-archive.key \
|
||||||
https://dl.winehq.org/wine-builds/winehq.key
|
https://dl.winehq.org/wine-builds/winehq.key
|
||||||
# Use the actual Ubuntu codename of the runner
|
|
||||||
CODENAME=$(lsb_release -cs)
|
CODENAME=$(lsb_release -cs)
|
||||||
sudo wget -qO /etc/apt/sources.list.d/winehq-${CODENAME}.sources \
|
sudo wget -qO /etc/apt/sources.list.d/winehq-${CODENAME}.sources \
|
||||||
"https://dl.winehq.org/wine-builds/ubuntu/dists/${CODENAME}/winehq-${CODENAME}.sources"
|
"https://dl.winehq.org/wine-builds/ubuntu/dists/${CODENAME}/winehq-${CODENAME}.sources"
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install --install-recommends winehq-stable -y
|
sudo apt-get install --install-recommends winehq-stable xvfb -y
|
||||||
|
|
||||||
- name: Set up Wine prefix
|
- name: Set up Wine prefix (headless)
|
||||||
run: |
|
run: |
|
||||||
mkdir -p "$WINEPREFIX"
|
mkdir -p "$WINEPREFIX"
|
||||||
wineboot --init
|
xvfb-run wineboot --init
|
||||||
|
|
||||||
- name: Download Python installer
|
- name: Download Python installer
|
||||||
run: |
|
run: |
|
||||||
@@ -49,31 +49,31 @@ jobs:
|
|||||||
https://www.python.org/ftp/python/3.12.4/python-3.12.4-amd64.exe \
|
https://www.python.org/ftp/python/3.12.4/python-3.12.4-amd64.exe \
|
||||||
-O /tmp/python.exe
|
-O /tmp/python.exe
|
||||||
|
|
||||||
- name: Install Python in Wine
|
- name: Install Python in Wine (headless)
|
||||||
run: |
|
run: |
|
||||||
wine /tmp/python.exe \
|
xvfb-run wine /tmp/python.exe \
|
||||||
/quiet \
|
/quiet \
|
||||||
InstallAllUsers=1 \
|
InstallAllUsers=1 \
|
||||||
PrependPath=1 \
|
PrependPath=1 \
|
||||||
Include_test=0
|
Include_test=0
|
||||||
rm /tmp/python.exe
|
rm /tmp/python.exe
|
||||||
|
|
||||||
- name: Install Python dependencies
|
- name: Install Python dependencies (headless)
|
||||||
run: |
|
run: |
|
||||||
cd server
|
cd server
|
||||||
wine "$WINEPYTHON" -m pip install --upgrade pip
|
xvfb-run wine "$WINEPYTHON" -m pip install --upgrade pip
|
||||||
wine "$WINEPYTHON" -m pip install -r requirements.txt
|
xvfb-run wine "$WINEPYTHON" -m pip install -r requirements.txt
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests (headless)
|
||||||
run: |
|
run: |
|
||||||
cd server
|
cd server
|
||||||
wine "$WINEPYTHON" -m pip install pytest pytest-asyncio
|
xvfb-run wine "$WINEPYTHON" -m pip install pytest pytest-asyncio
|
||||||
wine "$WINEPYTHON" -m pytest tests/ -v
|
xvfb-run wine "$WINEPYTHON" -m pytest tests/ -v
|
||||||
|
|
||||||
- name: Build .exe with PyInstaller
|
- name: Build .exe with PyInstaller (headless)
|
||||||
run: |
|
run: |
|
||||||
cd server
|
cd server
|
||||||
wine "$WINEPYTHON" -m PyInstaller \
|
xvfb-run wine "$WINEPYTHON" -m PyInstaller \
|
||||||
tray_wrapper.py \
|
tray_wrapper.py \
|
||||||
--name PaperDash \
|
--name PaperDash \
|
||||||
--onefile \
|
--onefile \
|
||||||
@@ -93,17 +93,14 @@ jobs:
|
|||||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
RELEASE_TAG: rolling-draft
|
RELEASE_TAG: rolling-draft
|
||||||
run: |
|
run: |
|
||||||
# API base URL (e.g. https://your-gitea.example.com/api/v1)
|
|
||||||
API="${{ github.api_url }}/repos/${{ github.repository }}"
|
API="${{ github.api_url }}/repos/${{ github.repository }}"
|
||||||
|
|
||||||
# Check if release for this tag already exists
|
|
||||||
RESPONSE=$(curl -sS -H "Authorization: token $GITEA_TOKEN" \
|
RESPONSE=$(curl -sS -H "Authorization: token $GITEA_TOKEN" \
|
||||||
"$API/releases/tags/$RELEASE_TAG")
|
"$API/releases/tags/$RELEASE_TAG")
|
||||||
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id // empty')
|
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id // empty')
|
||||||
|
|
||||||
if [ -n "$RELEASE_ID" ]; then
|
if [ -n "$RELEASE_ID" ]; then
|
||||||
echo "Updating existing draft release (ID $RELEASE_ID)"
|
echo "Updating existing draft release (ID $RELEASE_ID)"
|
||||||
# Update draft status and body
|
|
||||||
curl -sS -X PATCH -H "Authorization: token $GITEA_TOKEN" \
|
curl -sS -X PATCH -H "Authorization: token $GITEA_TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{
|
-d '{
|
||||||
@@ -113,7 +110,6 @@ jobs:
|
|||||||
}' \
|
}' \
|
||||||
"$API/releases/$RELEASE_ID"
|
"$API/releases/$RELEASE_ID"
|
||||||
|
|
||||||
# Delete existing assets of this release (so we can upload a fresh one)
|
|
||||||
ASSETS=$(curl -sS -H "Authorization: token $GITEA_TOKEN" \
|
ASSETS=$(curl -sS -H "Authorization: token $GITEA_TOKEN" \
|
||||||
"$API/releases/$RELEASE_ID/assets")
|
"$API/releases/$RELEASE_ID/assets")
|
||||||
for asset_id in $(echo "$ASSETS" | jq -r '.[].id'); do
|
for asset_id in $(echo "$ASSETS" | jq -r '.[].id'); do
|
||||||
@@ -134,7 +130,6 @@ jobs:
|
|||||||
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
|
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Upload the .exe as a release asset
|
|
||||||
echo "Uploading PaperDash.exe to release $RELEASE_ID"
|
echo "Uploading PaperDash.exe to release $RELEASE_ID"
|
||||||
curl -sS -X POST -H "Authorization: token $GITEA_TOKEN" \
|
curl -sS -X POST -H "Authorization: token $GITEA_TOKEN" \
|
||||||
-F "attachment=@server/dist/PaperDash.exe;type=application/vnd.microsoft.portable-executable" \
|
-F "attachment=@server/dist/PaperDash.exe;type=application/vnd.microsoft.portable-executable" \
|
||||||
|
|||||||
Reference in New Issue
Block a user