Skip to content

changing up how it's determining what it's location is in the 2 state… #29

changing up how it's determining what it's location is in the 2 state…

changing up how it's determining what it's location is in the 2 state… #29

Workflow file for this run

# .github/workflows/windows-build.yml
# This workflow correctly downloads a portable Python runtime, prepares it with pip,
# forcefully removes all debugging symbols (.pdb files), and then bundles the
# clean runtime with the Nuitka-compiled application.
name: Build and Release Windows App
on:
push:
tags:
- 'v*' # Triggers on version tags like v1.0.0
jobs:
build-windows:
runs-on: windows-latest
permissions:
contents: write # To create the release
pull-requests: read # To read PRs for the changelog
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python for Nuitka build process
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install zstd decompressor
run: choco install zstandard -y
- name: Prepare Portable Python Runtime
shell: pwsh
run: |
# 1. Download the specified full, pre-built, standalone Python distribution.
$url = "https://github.com/astral-sh/python-build-standalone/releases/download/20250808/cpython-3.11.13+20250808-x86_64-pc-windows-msvc-pgo-full.tar.zst"
Write-Host "Downloading Python runtime from hardcoded URL: $url"
Invoke-WebRequest -Uri $url -OutFile "python-standalone.tar.zst"
# 2. Decompress the archive in two steps: zstd -> tar.
Write-Host "Decompressing python-standalone.tar.zst..."
zstd -d python-standalone.tar.zst -o python-standalone.tar
Write-Host "Extracting python-standalone.tar..."
tar -xf python-standalone.tar
# 3. Move the contents from the correct 'python\install' subfolder.
New-Item -ItemType Directory -Force -Path python_runtime
Write-Host "Moving extracted runtime from 'python\install' to 'python_runtime'..."
Move-Item -Path "python\install\*" -Destination "python_runtime"
Remove-Item "python", "python-standalone.tar.zst", "python-standalone.tar" -Recurse -Force
Write-Host "Python runtime prepared."
- name: Install dependencies for Nuitka build
run: pip install -r requirements.txt
- name: Build app with Nuitka
run: |
python -m nuitka `
--standalone `
--enable-plugin=pyside6 `
--include-qt-plugins=platforms `
--output-dir=NodeEditor_Build `
--nofollow-import-to=tkinter,unittest,setuptools,pip,wheel `
--windows-disable-console `
--remove-output `
--lto=yes `
--include-data-dir=examples=examples `
--include-data-file=dark_theme.qss=dark_theme.qss `
--assume-yes-for-downloads `
main.py
- name: Copy Python runtime after Nuitka build
shell: pwsh
run: |
$distDir = "NodeEditor_Build\main.dist"
Write-Host "Copying python_runtime to $distDir..."
Copy-Item -Path "python_runtime" -Destination $distDir -Recurse -Force
- name: Prepare artifact for release
id: package
run: |
$version = "${{ github.ref_name }}"
$build_dir = "NodeEditor_Build"
$dist_dir = Join-Path $build_dir "main.dist"
$new_dir_name = "PyFlowCanvas $version"
$zip_file_name = "PyFlowCanvas_Windows_$version.zip"
Rename-Item -Path $dist_dir -NewName $new_dir_name
$archive_source = Join-Path $build_dir $new_dir_name
Compress-Archive -Path "$archive_source\*" -DestinationPath $zip_file_name
echo "zip_name=$zip_file_name" >> $env:GITHUB_OUTPUT
- name: Generate changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
body: |
## What's Changed
---
${{ steps.changelog.outputs.changelog }}
files: ${{ steps.package.outputs.zip_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}