Add files via upload #10
This file contains 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: Build and Deploy Executable | |
on: | |
push: | |
branches: | |
- main # ajuste conforme sua branch principal | |
jobs: | |
build: | |
runs-on: windows-latest # alterado para executar em ambiente Windows | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' # ajuste conforme sua versão de Python | |
- name: Install PyInstaller | |
run: | | |
python -m pip install pyinstaller | |
- name: Install PyQt5 and dependencies | |
run: | | |
python -m pip install pyqt5 pyqt5-tools | |
- name: Build executable | |
run: | | |
pyinstaller --onefile --noconsole passwordgen.py | |
- name: Check output | |
run: | | |
dir dist # Verificar se o executável foi gerado corretamente no Windows | |
- name: Create versioned folder | |
run: | | |
if (Test-Path programa) { | |
Write-Host "Directory 'programa' already exists." | |
} else { | |
New-Item -ItemType Directory -Path programa | |
} | |
$timestamp = Get-Date -Format "yyyyMMdd_HHmmss" | |
Move-Item dist\passwordgen.exe programa\app_v_${timestamp}.exe | |
- name: Configure Git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- name: Commit executable | |
if: success() | |
run: | | |
git add programa\app_v_*.exe | |
git commit -m "Add executable for version $timestamp" | |
git push |