fix: Release naming #5
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 Auto-Release EXE | |
| on: | |
| push: | |
| branches: | |
| - main # Runs on push to main | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" | |
| - name: Install Dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| pip install pyinstaller | |
| - name: Build EXE with PyInstaller | |
| run: pyinstaller --onefile gui.py | |
| - name: Wait for EXE and Move | |
| shell: pwsh | |
| run: | | |
| while (-not (Test-Path "dist/gui.exe")) { Start-Sleep -Seconds 1 } | |
| mv dist/gui.exe gui.exe -Force | |
| - name: Cleanup Unwanted Files | |
| shell: pwsh | |
| run: | | |
| Remove-Item -Recurse -Force build, dist, gui.spec | |
| - name: Upload EXE as Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: built-exe | |
| path: gui.exe | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Download Built EXE | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: built-exe | |
| - name: Bump Version and Create Tag | |
| id: tag | |
| uses: anothrNick/github-tag-action@v1 | |
| with: | |
| default_bump: patch # Change to minor or major if needed | |
| tag_prefix: "v" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.new_tag }} | |
| name: Release ${{ steps.tag.outputs.new_tag }} | |
| draft: false | |
| prerelease: false | |
| files: gui.exe | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |