client-py/.gitea/workflows/release.yml
borderban 87f661f2a6
Some checks failed
Build and Publish Release / Build Windows (push) Failing after 46s
Build and Publish Release / Build Linux (push) Successful in 3m57s
Build and Publish Release / Upload Assets to Release (push) Has been skipped
test
2026-05-04 20:37:06 +05:00

80 lines
No EOL
2.5 KiB
YAML

name: Build and Publish Release
on:
push:
release:
types: [published]
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: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Build Linux executable
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-latest
container:
image: git.borderban.ru/borderban/ci-images/py-builder:latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Python dependencies (Windows)
# Используем новый гарантированный путь из нашего Dockerfile (C:\python311)
run: |
xvfb-run wine "C:\python311\python.exe" -m pip install -r requirements.txt
- name: Build Windows executable
# Теперь PyInstaller вызывается через гарантированно существующий экзешник
run: |
xvfb-run wine "C:\python311\python.exe" -m PyInstaller --onefile --windowed --name factorio-mod-sync-windows 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-latest
if: github.event_name == 'release' || github.event_name == 'push'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Add files to Forgejo Release
uses: https://github.com/softprops/action-gh-release@v2
with:
fail_on_unmatched_files: false
files: |
artifacts/linux-build/factorio-mod-sync-linux
artifacts/windows-build/factorio-mod-sync-windows.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}