test on local image
Some checks failed
Build and Publish Release / Build Linux (release) Has been cancelled
Build and Publish Release / Build Windows (release) Has been cancelled
Build and Publish Release / Upload Assets to Release (release) Has been cancelled
Build and Publish Release / Build Windows (push) Failing after 2m15s
Build and Publish Release / Build Linux (push) Successful in 6m37s
Build and Publish Release / Upload Assets to Release (push) Has been skipped

This commit is contained in:
borderban 2026-05-04 19:59:56 +05:00
parent 0c47d8c0a9
commit ab82ba74e2

View file

@ -1,6 +1,7 @@
name: Build and Publish Release
on:
push: # Для теста лучше использовать push, чтобы не создавать релиз каждый раз
release:
types: [published]
@ -8,23 +9,21 @@ jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
container:
image: git.borderban.ru/borderban/ci-images/py-builder:latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
# Кэшируем pip, чтобы не качать зависимости из requirements.txt каждый раз
- name: Cache pip
uses: actions/cache@v3
with:
python-version: '3.11'
- name: Install system dependencies (Tkinter)
run: apt-get update && apt-get install -y python3-tk
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
run: pip install -r requirements.txt
- name: Build Linux executable
run: pyinstaller --onefile --windowed --name factorio-mod-sync-linux main.py
@ -39,21 +38,20 @@ jobs:
name: Build Windows
runs-on: ubuntu-latest
container:
image: tobix/pywine:3.11
image: git.borderban.ru/borderban/ci-images/py-builder:latest
steps:
- name: Install Node.js and Git (required for Actions)
run: apt-get update && apt-get install -y nodejs git
- name: Checkout code
uses: actions/checkout@v4
- name: Install Python dependencies (Windows)
run: |
wine python -m pip install --upgrade pip
wine pip install -r requirements.txt
wine pip install pyinstaller
# В твоем образе py-builder мы ставим пакеты обычно,
# а pyinstaller упакует их под Windows благодаря Wine внутри
pip install -r requirements.txt
- name: Build Windows executable
# Внутри твоего контейнера вызывай сборку.
# Если в образе настроен wine как алиас или через него — используй его.
run: wine pyinstaller --onefile --windowed --name factorio-mod-sync-windows.exe main.py
- name: Upload Windows artifact
@ -66,7 +64,8 @@ jobs:
name: Upload Assets to Release
needs: [build-linux, build-windows]
runs-on: ubuntu-latest
if: always() && (needs.build-linux.result == 'success' || needs.build-windows.result == 'success')
# Этот шаг запустится только если это реально Релиз
if: github.event_name == 'release'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3