Build and Release #18
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 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag (v1.0.0)' | |
| required: true | |
| default: 'v2.1.8' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| python3-dev \ | |
| build-essential \ | |
| libgl1-mesa-dev \ | |
| libxcb-xinerama0 \ | |
| libxkbcommon-x11-0 \ | |
| libxcb-icccm4 \ | |
| libxcb-image0 \ | |
| libxcb-keysyms1 \ | |
| libxcb-randr0 \ | |
| libxcb-render-util0 \ | |
| libxcb-shape0 \ | |
| libxcb-xfixes0 \ | |
| libxcb-xkb1 | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install PySide6 PyInstaller | |
| # Add any other Python dependencies your app needs | |
| # pip install -r requirements.txt | |
| - name: Build with PyInstaller | |
| run: | | |
| # Create the executable - adjust main_script.py to your actual entry point | |
| pyinstaller --onefile --windowed --name welcome main_script.py | |
| # Alternative if you need console output during development: | |
| # pyinstaller --onefile --name welcome main_script.py | |
| - name: Test the built executable | |
| run: | | |
| # Basic test to ensure the binary was created | |
| ls -la dist/ | |
| file dist/welcome | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: welcome-linux | |
| path: dist/welcome | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: welcome-linux | |
| path: dist/ | |
| - name: Create Release | |
| id: create_release | |
| uses: elgohr/Github-Release-Action@v2 | |
| with: | |
| title: ${{ github.event.inputs.tag }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload Release Asset | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/welcome | |
| name: "welcome-linux-${{ github.event.inputs.tag }}" | |
| make_latest: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |