Skip to content

Fix the problem of version displayed in about section #40

Fix the problem of version displayed in about section

Fix the problem of version displayed in about section #40

Workflow file for this run

name: Build and Release BulkFolder
on:
push:
branches:
- main
permissions:
contents: write
jobs:
sonar-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
# Cette étape vérifie si le secret est vide avant de lancer Docker
- name: Check Secret Presence
shell: bash
run: |
if [ -z "${{ secrets.BULK_FOLDER_SCAN }}" ]; then
echo "ERREUR : Le secret BULK_FOLDER_SCAN est vide ou introuvable."
exit 1
fi
- name: SonarCloud Scan
# On utilise ici la version explicite qui a le moins de bugs de transmission d'env
uses: SonarSource/sonarcloud-github-action@v3.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.BULK_FOLDER_SCAN }}
build:
needs: sonar-scan
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: 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@v2
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 }}