Build and Attach Apps #17
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: Build and Attach Apps | |
| on: | |
| release: | |
| types: [created] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-macOS-app-apple-silicon: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Print ref and SHA | |
| run: echo "REF=${{ github.ref_name }} SHA=${{ github.sha }}" | |
| - name: Check out the branch | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pyinstaller | |
| - name: Pack source code | |
| run: | | |
| mkdir -p dist | |
| zip -r dist/cat-relay-src.zip . | |
| - name: Attach source code to release | |
| if: github.event_name == 'release' | |
| uses: actions/upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: dist/cat-relay-src.zip | |
| asset_name: cat-relay-src.zip | |
| asset_content_type: application/zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build macOS App - Apple Silicon | |
| env: | |
| ARCHFLAGS: "-arch arm64" # Apple Silicon | |
| run: | | |
| pyinstaller app.py --name CatRelay --windowed --distpath dist/mac-arm | |
| - name: Pack macOS app - Apple Silicon | |
| run: | | |
| cd dist/mac-arm | |
| zip -r ../cat-relay-mac-arm.zip CatRelay.app | |
| shell: bash | |
| - name: Attach macOS App - Apple Silicon to release | |
| if: github.event_name == 'release' | |
| uses: actions/upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: dist/cat-relay-mac-arm.zip | |
| asset_name: cat-relay-mac-arm.zip | |
| asset_content_type: application/zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-macOS-app-intel: | |
| runs-on: macos-15-intel | |
| steps: | |
| - name: Print ref and SHA | |
| run: echo "REF=${{ github.ref_name }} SHA=${{ github.sha }}" | |
| - name: Check out the branch | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pyinstaller | |
| - name: Build macOS App - Intel | |
| run: | | |
| pyinstaller app.py --name CatRelay --windowed --distpath dist/mac-x64 | |
| - name: Pack macOS app - Intel | |
| run: | | |
| cd dist/mac-x64 | |
| zip -r ../cat-relay-mac-x64.zip CatRelay.app | |
| shell: bash | |
| - name: Attach macOS App - Intel to release | |
| if: github.event_name == 'release' | |
| uses: actions/upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: dist/cat-relay-mac-x64.zip | |
| asset_name: cat-relay-mac-x64.zip | |
| asset_content_type: application/zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-windows-app: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Print ref and SHA | |
| run: echo "REF=${{ github.ref_name }} SHA=${{ github.sha }}" | |
| - name: Check out the branch | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pyinstaller | |
| - name: Build Windows App | |
| run: | | |
| pyinstaller app.py --name CatRelay --windowed --distpath dist/windows | |
| - name: Pack Windows App | |
| run: | | |
| cd dist/windows | |
| Compress-Archive -Path .\* -DestinationPath ../cat-relay-win.zip | |
| - name: Attach Windows App to release | |
| if: github.event_name == 'release' | |
| uses: actions/upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: dist/cat-relay-win.zip | |
| asset_name: cat-relay-win.zip | |
| asset_content_type: application/zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |