Skip to content

Build EXE with Secrets #29

Build EXE with Secrets

Build EXE with Secrets #29

Workflow file for this run

name: Build EXE with Secrets
on:
push:
branches:
- main # Trigger workflow for main branch
workflow_dispatch: # Allow manual runs
jobs:
build-exe:
runs-on: windows-latest # Use Windows for building .exe files
steps:
# Step 1: Check out the code
- name: Checkout Code
uses: actions/checkout@v3
# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
# Step 3: Install Python dependencies
- name: Install Dependencies
run: pip install -r requirements.txt
# Step 4: Build the EXE
- name: Build EXE
env: # Pass secrets as environment variables
VPN_USERNAME: ${{ secrets.VPN_USERNAME }}
VPN_PASSWORD: ${{ secrets.VPN_PASSWORD }}
TOTP_SECRET: ${{ secrets.TOTP_SECRET }}
run: |
echo "Building EXE..."
pyinstaller --onefile totp.py
# Step 5: Save the EXE in the Repository (Private)
- name: Move EXE to Safe Location
run: |
mkdir -p compiled_exes
move dist\\totp.exe compiled_exes\\my_private_totp.exe
# Optional: Restrict write access in repo to trusted collaborators