Merge pull request #17 from Ashraf-Khabar/create-the-installer-for-th… #7
This file contains hidden or 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 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 | |
| # Extraction de la version depuis project_info.xml | |
| - name: Build EXE | |
| run: | | |
| # Création du lanceur pour éviter les erreurs d'import | |
| 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" --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 }} |