Skip to content

Merge pull request #24 from ZylosCore/fixing-ui-problems #19

Merge pull request #24 from ZylosCore/fixing-ui-problems

Merge pull request #24 from ZylosCore/fixing-ui-problems #19

Workflow file for this run

name: Build and Release BulkFolder
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
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 pyinstaller customtkinter matplotlib
- name: Get version from XML
id: get_version
shell: powershell
run: |
[xml]$project = Get-Content "project_info.xml"
$version = $project.project.version
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
- name: Create version_info.txt
shell: powershell
run: |
$ver = "${{ steps.get_version.outputs.VERSION }}".Split('.')
$v1,$v2,$v3 = $ver[0],$ver[1],$ver[2]
$template = @"
VSVersionInfo(
ffi=FixedFileInfo(filevers=($v1,$v2,$v3,0), prodvers=($v1,$v2,$v3,0), mask=0x3f, flags=0x0, OS=0x40004, fileType=0x1, subtype=0x0, date=(0, 0)),
kids=[StringFileInfo([StringTable(u'040904B0', [
StringStruct(u'CompanyName', u'BulkFolder Contributors'),
StringStruct(u'FileDescription', u'Bulk folder organizer and renamer'),
StringStruct(u'FileVersion', u'${{ steps.get_version.outputs.VERSION }}'),
StringStruct(u'InternalName', u'BulkFolder'),
StringStruct(u'LegalCopyright', u'MIT License'),
StringStruct(u'OriginalFilename', u'BulkFolder.exe'),
StringStruct(u'ProductName', u'BulkFolder'),
StringStruct(u'ProductVersion', u'${{ steps.get_version.outputs.VERSION }}')])]),
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])]
)
"@
$template | Out-File -FilePath version_info.txt -Encoding utf8
- name: Build EXE with PyInstaller
run: |
echo "import sys, os; sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src')); from bulkfolder.ui.main import main; main()" > run.py
python -m PyInstaller --noconfirm --windowed --name "BulkFolder" --icon="src/assets/logo.ico" --add-data="src/assets;assets" --paths="src" --version-file="version_info.txt" --collect-all customtkinter run.py
- name: Compile Inno Setup
shell: pwsh
run: |
$ver = "${{ steps.get_version.outputs.VERSION }}"
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DMyAppVersion=$ver "installer_script.iss"
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.get_version.outputs.VERSION }}
name: Release v${{ steps.get_version.outputs.VERSION }}
files: Output/*.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}