From e78f0053af3adc8b874ca3d9cdcf789bf569d5ad Mon Sep 17 00:00:00 2001 From: borderban Date: Sat, 2 May 2026 16:34:44 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B8=D0=B3=D1=80=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BD=D0=B0=20=D0=A1=D0=92=D0=9E=D1=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 31 -------------- release.yml | 81 +++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/release.yml create mode 100644 release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 29d4073..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build Release -on: - push: - tags: - - 'v*' # Сработает, когда вы создадите тег версии (например, v1.0) - -jobs: - build-windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.12.3' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pyinstaller -r requirements.txt - - - name: Build EXE - run: pyinstaller --onefile main.py # Замените main.py на ваш главный файл - - - name: Release - uses: softprops/action-gh-release@v2 - with: - files: dist/main.exe - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/release.yml b/release.yml new file mode 100644 index 0000000..d05126e --- /dev/null +++ b/release.yml @@ -0,0 +1,81 @@ +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 }} \ No newline at end of file