fix: remove unused imports (F401) and bare f-strings (F541), fix NSIS… #2
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version sans le "v" (ex: 0.1.0)' | |
| required: true | |
| default: '0.1.0' | |
| jobs: | |
| build_and_release: | |
| name: Build installer and create release | |
| runs-on: windows-latest | |
| env: | |
| PYTHONUTF8: '1' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Resolve version | |
| id: version | |
| shell: pwsh | |
| run: | | |
| if ('${{ github.event_name }}' -eq 'workflow_dispatch') { | |
| $v = '${{ github.event.inputs.version }}'.TrimStart('v') | |
| } else { | |
| $v = '${{ github.ref_name }}'.TrimStart('v') | |
| } | |
| echo "VERSION=$v" >> $env:GITHUB_OUTPUT | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -e . | |
| pip install pyinstaller | |
| - name: Prepare build assets | |
| run: | | |
| python tools/prepare_build.py | |
| - name: Build PyInstaller bundle | |
| run: | | |
| pyinstaller PDF-Equilibrist.spec | |
| - name: Install NSIS (Chocolatey) | |
| run: | | |
| choco install nsis -y | |
| - name: Build NSIS installer | |
| shell: pwsh | |
| run: | | |
| $v = '${{ steps.version.outputs.VERSION }}' | |
| New-Item -ItemType Directory -Path installer\Output -Force | |
| & 'C:\Program Files (x86)\NSIS\makensis.exe' "/DAPP_VERSION=$v" 'installer\PDF-Equilibrist.nsi' | |
| - name: Create GitHub release and upload asset | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.version.outputs.VERSION }} | |
| name: Release v${{ steps.version.outputs.VERSION }} | |
| draft: false | |
| prerelease: false | |
| files: installer/Output/PDF-Equilibrist-Setup.exe |