Skip to content

Build Release

Build Release #11

Workflow file for this run

name: Build Release
on:
workflow_dispatch:
workflow_call: # Required for orchestration
permissions:
contents: write
packages: write
actions: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Get App Version
id: app_version
shell: pwsh
run: |
$version = Get-Content version.txt -Raw
$version = $version.Trim()
echo "version=$version" >> $env:GITHUB_OUTPUT
- name: Get Python version
id: python-version
run: |
$pythonVersion = (python --version).Split(" ")[1]
echo "version=$pythonVersion" >> $env:GITHUB_OUTPUT
shell: pwsh
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ steps.python-version.outputs.version }}
- name: Install build tools
run: pip install pyinstaller
- name: Install dependencies
run: pip install pywin32 PyQt6
- name: Generate requirements.txt
shell: pwsh
run: |
$reqs = pip freeze | Select-String "pywin32", "PyQt6"
$reqs = $reqs -join "`n"
[System.IO.File]::WriteAllText("requirements.txt", $reqs)
- name: Commit requirements.txt
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: 'feat(build): update requirements.txt with exact versions'
file_pattern: requirements.txt
- name: Set up UPX
run: choco install upx -y
- name: Build EXE
run: pyinstaller compile.spec
- name: Create artifact folder
shell: pwsh
run: |
if (!(Test-Path artifact_contents)) { mkdir artifact_contents }
move dist\desktop-icon-backup-manager_*.exe "artifact_contents/Desktop Icon Backup Manager.exe"
- name: Save ZIP artifact
uses: actions/upload-artifact@v5
with:
name: desktop-icon-backup-manager_v${{ steps.app_version.outputs.version }}
path: artifact_contents/
- name: Create Release ZIP
shell: pwsh
run: Compress-Archive -Path artifact_contents/* -DestinationPath desktop-icon-backup-manager_v${{ steps.app_version.outputs.version }}.zip -Force
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
files: desktop-icon-backup-manager_v${{ steps.app_version.outputs.version }}.zip
tag_name: v${{ steps.app_version.outputs.version }}
name: Release v${{ steps.app_version.outputs.version }}
generate_release_notes: true
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}