Skip to content

Update build.yml

Update build.yml #9

Workflow file for this run

name: Build with Nuitka
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python-version: ["3.9", "3.10", "3.11"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y gcc patchelf
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install gcc patchelf
- name: Install system dependencies (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
$url = "https://dependencywalker.com/depends22_x64.zip"
$targetDir = "$env:LOCALAPPDATA\Nuitka\Nuitka\Cache\downloads\depends\x86_64"
$urlZip = "$targetDir\depends22_x64.zip"
New-Item -ItemType Directory -Path $targetDir -Force | Out-Null
Invoke-WebRequest -Uri $url -OutFile $urlZip
Expand-Archive -Path $urlZip -DestinationPath $targetDir -Force
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install nuitka
pip install -r requirements.txt
- name: Build with Nuitka
run: |
python -m nuitka --standalone --onefile --enable-plugin=pyside6 --windows-console-mode=disable --include-data-dir=assets=assets --output-dir=dist --include-data-files=modules/UML/*.dll=modules/UML/ --output-filename=TJHanTools __init__.py
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: TianjiHanTools-${{ runner.os }}-${{ matrix.python-version }}
path: dist/TJHanTools${{ runner.os == 'Windows' && '.exe' || '' }}