Skip to content

Add GitHub Actions workflow for automated PyInstaller builds#1

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-github-actions-workflow
Draft

Add GitHub Actions workflow for automated PyInstaller builds#1
Copilot wants to merge 2 commits intomainfrom
copilot/add-github-actions-workflow

Conversation

Copy link
Copy Markdown

Copilot AI commented Oct 16, 2025

Overview

This PR adds a GitHub Actions workflow that automatically builds ExcleTransform.py into a Windows executable using PyInstaller whenever the script or its dependencies change.

What's Added

A new workflow file at .github/workflows/pyinstaller-build.yml that:

  • Automatically triggers on push events when:
    • ExcleTransform.py is modified
    • requirements.txt is modified
    • The workflow file itself is modified
  • Supports manual execution via workflow_dispatch for on-demand builds
  • Runs on Windows (windows-latest) to ensure native compatibility
  • Sets up Python 3.x with pip caching for faster builds

Build Process

The workflow intelligently handles dependencies:

  • If requirements.txt exists, it installs all dependencies from it, plus PyInstaller
  • If requirements.txt is missing, it installs the minimal runtime dependencies: PyInstaller, pandas, xlrd, and openpyxl

The build uses PyInstaller with the --onefile flag to create a single, portable executable:

pyinstaller --noconfirm --onefile --name ExcleTransform ExcleTransform.py

Artifacts

After each successful build, the workflow uploads ExcleTransform.exe as a GitHub Actions artifact:

  • Artifact name: ExcleTransform-exe
  • Retention: 7 days
  • Error handling: Fails the workflow if the executable is not created

Benefits

  • ✅ Automated builds ensure the executable is always up-to-date with the latest code
  • ✅ No manual PyInstaller setup required for contributors
  • ✅ Easy access to Windows executables without needing a Windows development environment
  • ✅ Build artifacts are automatically available for download from the Actions tab

Changes

  • Added: .github/workflows/pyinstaller-build.yml
  • Modified: None (no existing files were changed)
Original prompt

Add a GitHub Actions workflow that builds ExcleTransform.py into a Windows .exe using PyInstaller whenever the script changes.

Repository: ZC-TigerRoot/ExcelTransform

Requirements:

  • Create a workflow file at .github/workflows/pyinstaller-build.yml.
  • Triggers:
    • push on changes to ExcleTransform.py, requirements.txt, or the workflow file itself.
    • workflow_dispatch for manual runs.
  • Environment: windows-latest.
  • Steps:
    1. actions/checkout@v4
    2. actions/setup-python@v5 with python-version: "3.x" and pip cache
    3. Install dependencies:
      • Always upgrade pip.
      • If requirements.txt exists, install: pip install -r requirements.txt and pip install pyinstaller.
      • If it does not exist, install minimal runtime deps needed to build the exe: pip install pyinstaller pandas xlrd openpyxl.
    4. Build with: pyinstaller --noconfirm --onefile --name ExcleTransform ExcleTransform.py
    5. Upload artifact using actions/upload-artifact@v4 with:
      • name: ExcleTransform-exe
      • path: dist/ExcleTransform.exe
      • if-no-files-found: error
      • retention-days: 7

Notes:

  • ExcleTransform.py is at the repository root.
  • Ensure the workflow runs successfully even when the repo does not include requirements.txt by installing pandas/xlrd/openpyxl in that case.
  • Do not change any existing repository files other than adding the new workflow.

This pull request was created as a result of the following prompt from Copilot chat.

Add a GitHub Actions workflow that builds ExcleTransform.py into a Windows .exe using PyInstaller whenever the script changes.

Repository: ZC-TigerRoot/ExcelTransform

Requirements:

  • Create a workflow file at .github/workflows/pyinstaller-build.yml.
  • Triggers:
    • push on changes to ExcleTransform.py, requirements.txt, or the workflow file itself.
    • workflow_dispatch for manual runs.
  • Environment: windows-latest.
  • Steps:
    1. actions/checkout@v4
    2. actions/setup-python@v5 with python-version: "3.x" and pip cache
    3. Install dependencies:
      • Always upgrade pip.
      • If requirements.txt exists, install: pip install -r requirements.txt and pip install pyinstaller.
      • If it does not exist, install minimal runtime deps needed to build the exe: pip install pyinstaller pandas xlrd openpyxl.
    4. Build with: pyinstaller --noconfirm --onefile --name ExcleTransform ExcleTransform.py
    5. Upload artifact using actions/upload-artifact@v4 with:
      • name: ExcleTransform-exe
      • path: dist/ExcleTransform.exe
      • if-no-files-found: error
      • retention-days: 7

Notes:

  • ExcleTransform.py is at the repository root.
  • Ensure the workflow runs successfully even when the repo does not include requirements.txt by installing pandas/xlrd/openpyxl in that case.
  • Do not change any existing repository files other than adding the new workflow.

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: ZC-TigerRoot <66396101+ZC-TigerRoot@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub Actions workflow for building ExcleTransform.py Add GitHub Actions workflow for automated PyInstaller builds Oct 16, 2025
Copilot AI requested a review from ZC-TigerRoot October 16, 2025 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants