client-py/.gitea/workflows/release.yml
borderban ab82ba74e2
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
test on local image
2026-05-04 19:59:56 +05:00

83 lines
No EOL
2.9 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:
push: # Для теста лучше использовать 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
# Кэшируем pip, чтобы не качать зависимости из requirements.txt каждый раз
- 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)
run: |
# В твоем образе 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
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'
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 }}