Update build.yml

This commit is contained in:
InfernumVII 2026-03-17 01:52:28 +03:00 committed by GitHub
parent cf3e3b2aec
commit 4595380e73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 23 additions and 17 deletions

View File

@ -1,5 +1,4 @@
name: Build & Release name: Build & Release
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
@ -7,32 +6,36 @@ on:
description: "Release version tag (e.g. v1.0.0)" description: "Release version tag (e.g. v1.0.0)"
required: true required: true
default: "v1.0.0" default: "v1.0.0"
permissions: permissions:
contents: write contents: write
jobs: jobs:
build: build:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: "3.12" python-version: "3.12"
cache: "pip" cache: "pip"
- name: Install dependencies - name: Install dependencies
run: pip install -r requirements.txt run: pip install -r requirements.txt
- name: Install pyinstaller - name: Install pyinstaller
run: pip install pyinstaller run: pip install pyinstaller
- name: Rebuild PyInstaller bootloader
run: |
$version = python -c "import PyInstaller; print(PyInstaller.__version__)"
git clone --depth 1 --branch "v$version" https://github.com/pyinstaller/pyinstaller.git _pyinstaller_src
cd _pyinstaller_src/bootloader
python ./waf all --target-arch=64bit
$dest = python -c "import PyInstaller; import os; print(os.path.join(os.path.dirname(PyInstaller.__file__), 'bootloader', 'Windows-64bit-intel'))"
New-Item -ItemType Directory -Force -Path $dest
Copy-Item -Force .\build\release\* $dest
Copy-Item -Force .\build\releasew\* $dest
shell: pwsh
- name: Build EXE with PyInstaller - name: Build EXE with PyInstaller
run: pyinstaller packaging/windows.spec --noconfirm run: pyinstaller packaging/windows.spec --noconfirm
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@ -45,25 +48,30 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Python 3.8 (last version supporting Win7) - name: Setup Python 3.8 (last version supporting Win7)
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: "3.8" python-version: "3.8"
cache: "pip" cache: "pip"
- name: Install dependencies (Win7-compatible) - name: Install dependencies (Win7-compatible)
run: pip install -r requirements-win7.txt run: pip install -r requirements-win7.txt
- name: Install pyinstaller - name: Install pyinstaller
run: pip install "pyinstaller==5.13.2" run: pip install "pyinstaller==5.13.2"
- name: Rebuild PyInstaller bootloader
run: |
$version = python -c "import PyInstaller; print(PyInstaller.__version__)"
git clone --depth 1 --branch "v$version" https://github.com/pyinstaller/pyinstaller.git _pyinstaller_src
cd _pyinstaller_src/bootloader
python ./waf all --target-arch=64bit
$dest = python -c "import PyInstaller; import os; print(os.path.join(os.path.dirname(PyInstaller.__file__), 'bootloader', 'Windows-64bit-intel'))"
New-Item -ItemType Directory -Force -Path $dest
Copy-Item -Force .\build\release\* $dest
Copy-Item -Force .\build\releasew\* $dest
shell: pwsh
- name: Build EXE with PyInstaller (Win7) - name: Build EXE with PyInstaller (Win7)
run: pyinstaller packaging/windows.spec --noconfirm run: pyinstaller packaging/windows.spec --noconfirm
- name: Rename artifact - name: Rename artifact
run: mv dist/TgWsProxy.exe dist/TgWsProxy-win7.exe run: mv dist/TgWsProxy.exe dist/TgWsProxy-win7.exe
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@ -79,13 +87,11 @@ jobs:
with: with:
name: TgWsProxy name: TgWsProxy
path: dist path: dist
- name: Download Win7 build - name: Download Win7 build
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: TgWsProxy-win7 name: TgWsProxy-win7
path: dist path: dist
- name: Create GitHub Release - name: Create GitHub Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
@ -99,4 +105,4 @@ jobs:
draft: false draft: false
prerelease: false prerelease: false
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}