client-py/.gitea/workflows/release.yml
borderban 3f0bd7de81
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
кинул файл не туда
2026-05-02 16:39:06 +05:00

81 lines
No EOL
2.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Build and Publish Release
on:
release:
types: [published]
jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-main-runner
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install system dependencies (Tkinter)
# В Ubuntu для работы Tkinter необходим системный пакет python3-tk
run: sudo apt-get update && sudo apt-get install -y python3-tk
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build Linux executable
# Флаг --windowed убирает консоль, --onefile собирает все в один файл
run: pyinstaller --onefile --windowed --name factorio-mod-sync-linux main.py
- name: Upload Linux artifact
uses: actions/upload-artifact@v3
with:
name: linux-build
path: dist/factorio-mod-sync-linux
build-windows:
name: Build Windows
runs-on: ubuntu-main-runner
# Используем контейнер с настроенным Wine и Python 3.11 под Windows
container:
image: tobix/pywine:3.11
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Python dependencies (Windows)
run: |
wine python -m pip install --upgrade pip
wine pip install -r requirements.txt
wine pip install pyinstaller
- name: Build Windows executable
run: wine pyinstaller --onefile --windowed --name factorio-mod-sync-windows.exe main.py
- name: Upload Windows artifact
uses: actions/upload-artifact@v3
with:
name: windows-build
path: dist/factorio-mod-sync-windows.exe
release-assets:
name: Upload Assets to Release
needs: [build-linux, build-windows]
runs-on: ubuntu-main-runner
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Add files to Forgejo Release
uses: softprops/action-gh-release@v1
with:
files: |
linux-build/factorio-mod-sync-linux
windows-build/factorio-mod-sync-windows.exe
env:
# В Forgejo GITHUB_TOKEN автоматически мапится на внутренний токен доступа
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}