Nuitka Packaging (Config Editor) #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Nuitka Packaging (Config Editor) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version number to use for the build (must be a tuple of up to 4 integer values, e.g. 6.0)' | |
| required: true | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python (3.8, x64) | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.8' | |
| architecture: 'x64' | |
| - name: Cache Python dependencies | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~\AppData\Local\pip\Cache | |
| ~\AppData\Roaming\Python\Python38\site-packages | |
| key: ${{ runner.os }}-python-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-python- | |
| - name: Cache Nuitka dependencies | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~\AppData\Local\Nuitka\Nuitka\Cache | |
| key: ${{ runner.os }}-nuitka-${{ hashFiles('**/*.py') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuitka- | |
| - name: Install Visual Studio Build Tools 2015 (14.0) | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| toolset: 14.0 | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -U nuitka==4.0.8 | |
| pip install -r requirements.txt | |
| - name: Download Dependency Walker manually | |
| run: | | |
| # Create cache directory for Nuitka | |
| $cacheDir = "C:\Users\runneradmin\AppData\Local\Nuitka\Nuitka\Cache\downloads\depends\x86_64" | |
| New-Item -ItemType Directory -Path $cacheDir -Force | |
| # Check if Dependency Walker is already cached | |
| if (-not (Test-Path "$cacheDir\depends.exe")) { | |
| # Download Dependency Walker | |
| Invoke-WebRequest -Uri "https://dependencywalker.com/depends22_x64.zip" -OutFile "$cacheDir\depends.zip" | |
| # Extract the zip file | |
| Expand-Archive -Path "$cacheDir\depends.zip" -DestinationPath $cacheDir -Force | |
| } | |
| # Verify the files exist | |
| Get-ChildItem -Path $cacheDir | |
| - name: Package ConfigEditor with Nuitka | |
| run: | | |
| $version = "${{ github.event.inputs.version }}" | |
| $program = "ConfigEditor.py" | |
| if (Test-Path $program) { | |
| Write-Host "Packaging $program with version $version..." | |
| python -m nuitka --standalone --follow-imports --python-flag="-S" --main="$program" --remove-output --windows-icon-from-ico="PythonLight.ico" --file-version="$version" --product-name="Office-Backup-Utilities-Config-Editor" --company-name="TonyV2Intl" --product-version="$version" --copyright="Copyright (C) 2026 TonyV2Intl" --onefile --include-data-files=./PythonLight.ico=PythonLight.ico --msvc=14.0 --windows-console-mode=disable --enable-plugin=tk-inter --show-memory --show-progress | |
| } else { | |
| Write-Warning "File $program not found, skipping..." | |
| } | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| path: ConfigEditor.exe | |
| archive: false |