Create Release #1
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
| # .github/workflows/release.yml | |
| # Workflow for building and publishing executables for Windows and Linux on GitHub. | |
| # This runs when a new release is published via the GitHub UI or API. | |
| name: Create Release | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| name: Build on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - name: Checkout repository | |
| 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 -e .[dev] | |
| - name: Build Windows executable | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| python generate_version_file.py | |
| pyinstaller codecat.spec | |
| ren dist/codecat.exe codecat-windows.exe | |
| - name: Build Linux executable | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| pyinstaller --noconfirm --onefile --console --name codecat src/codecat/__main__.py | |
| mv dist/codecat dist/codecat-linux | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: codecat-build-${{ matrix.os }} | |
| path: dist/* | |
| create-release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Create release and upload assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| dist/codecat-linux | |
| dist/codecat-windows.exe | |
| fail_on_unmatched_files: true |