Skip to content

Create build-portable.yml #1

Create build-portable.yml

Create build-portable.yml #1

name: Build Portable EXE
on:
workflow_dispatch:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
build-windows-portable:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build portable exe
run: |
pyinstaller --onefile --windowed --name "ExcelComparePortable" main.py
- name: Prepare portable package
shell: pwsh
run: |
New-Item -ItemType Directory -Path portable -Force | Out-Null
Copy-Item "dist/ExcelComparePortable.exe" "portable/ExcelComparePortable.exe" -Force
if (Test-Path "test_data") {
Copy-Item "test_data" "portable/test_data" -Recurse -Force
}
Compress-Archive -Path "portable/*" -DestinationPath "dist/ExcelComparePortable.zip" -Force
- name: Upload EXE artifact
uses: actions/upload-artifact@v4
with:
name: ExcelComparePortable-exe
path: dist/ExcelComparePortable.exe
- name: Upload ZIP artifact
uses: actions/upload-artifact@v4
with:
name: ExcelComparePortable-zip
path: dist/ExcelComparePortable.zip