Unify CI jobs #32
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: "Stream Deck Plugin" | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| pull_request: | |
| paths: | |
| - streamdeck-plugin/** | |
| - com.chrisregado.googlemeet.sdPlugin/** | |
| - .github/workflows/** | |
| push: | |
| paths: | |
| - streamdeck-plugin/** | |
| - com.chrisregado.googlemeet.sdPlugin/** | |
| - .github/workflows/** | |
| branches: | |
| - '**' | |
| tags-ignore: | |
| # Don't run again on tags since we already run on all branches. | |
| - '**' | |
| jobs: | |
| build-plugin: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos | |
| runs_on: macos-latest | |
| - os: windows | |
| runs_on: windows-latest | |
| name: Build ${{ matrix.os }} Stream Deck Plugin | |
| runs-on: ${{ matrix.runs_on }} | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: streamdeck-plugin | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Set up Pip | |
| run: python -m pip install --upgrade pip | |
| - name: pip install | |
| run: pip install -r requirements.txt | |
| - name: Run unit tests | |
| run: python -m unittest | |
| - name: Bundle plugin | |
| run: pyinstaller --clean --dist ../com.chrisregado.googlemeet.sdPlugin/dist/${{ matrix.os }} src/main.py && rm -rf build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.os }}-plugin-intermediate-build | |
| path: ${{ github.workspace }}/com.chrisregado.googlemeet.sdPlugin/dist/${{ matrix.os }} | |
| bundle-streamdeck-distributable: | |
| name: Bundle multi-OS Stream Deck plugin distributable binary | |
| runs-on: macos-latest | |
| needs: [build-plugin] | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| - name: Download DistributionTool | |
| run: curl -L https://github.com/ChrisRegado/streamdeck-build-tools/raw/master/DistributionToolMac/DistributionTool -o DistributionTool | |
| - name: Make DistributionTool Executable | |
| run: chmod +x DistributionTool | |
| - name: Download macOS plugin artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: macos-plugin-intermediate-build | |
| path: com.chrisregado.googlemeet.sdPlugin/dist/macos | |
| - name: Download Windows plugin artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: windows-plugin-intermediate-build | |
| path: com.chrisregado.googlemeet.sdPlugin/dist/windows | |
| - name: Make output dir | |
| run: mkdir output | |
| - name: Bundle plugin | |
| run: ./DistributionTool -b -i ./com.chrisregado.googlemeet.sdPlugin -o output/ | |
| - name: Upload final plugin binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: com.chrisregado.googlemeet.streamDeckPlugin | |
| path: output/com.chrisregado.googlemeet.streamDeckPlugin | |
| attach-to-release: | |
| name: Attach artifacts to release | |
| if: ${{ github.event_name == 'release' }} | |
| runs-on: ubuntu-latest | |
| needs: [bundle-streamdeck-distributable] | |
| permissions: | |
| contents: write # Needed for softprops/action-gh-release | |
| steps: | |
| - name: Download Stream Deck plugin | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: com.chrisregado.googlemeet.streamDeckPlugin | |
| path: ./artifacts | |
| - name: Attach artifacts to release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| ./artifacts/com.chrisregado.googlemeet.streamDeckPlugin |