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 }}