-
Notifications
You must be signed in to change notification settings - Fork 44
129 lines (109 loc) · 4.13 KB
/
Copy pathstreamdeck-plugin-build.yml
File metadata and controls
129 lines (109 loc) · 4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: "Build Stream Deck Plugin" # If you change this name, you'll also need to update the release.yaml job
on:
workflow_dispatch:
pull_request:
paths:
- streamdeck-plugin/**
- com.chrisregado.googlemeet.sdPlugin/**
- .github/workflows/**
push:
paths:
- streamdeck-plugin/**
- com.chrisregado.googlemeet.sdPlugin/**
- .github/workflows/**
branches:
- '**'
tags:
# Only run on release tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
env:
PYTHON_VERSION: "3.13"
NODE_VERSION: "22" # See https://docs.elgato.com/streamdeck/cli/intro/ for supported Node.js versions
ELGATO_CLI_VERSION: "1.5.0"
jobs:
build-plugin:
strategy:
matrix:
include:
- os: macos
runs_on: macos-latest
- os: windows
runs_on: windows-latest
- os: linux
runs_on: ubuntu-latest
name: Build ${{ matrix.os }} Stream Deck Plugin
# Since we run on both branch pushes and PRs, don't do a duplicated run if the PR is for a branch in the local repo:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
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: ${{ env.PYTHON_VERSION }}
- 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: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Elgato streamdeck CLI tool
run: npm install -g "@elgato/cli@${{ env.ELGATO_CLI_VERSION }}"
- 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: Download Linux plugin artifact
uses: actions/download-artifact@v4
with:
name: linux-plugin-intermediate-build
path: com.chrisregado.googlemeet.sdPlugin/dist/linux
- name: Run Elgato linter
run: streamdeck validate --no-update-check com.chrisregado.googlemeet.sdPlugin
- name: Make output dir
run: mkdir ./build
- name: Bundle plugin
if: ${{ github.ref_type != 'tag' }}
run: streamdeck pack --output ./build/ --no-update-check com.chrisregado.googlemeet.sdPlugin
- name: Bundle plugin using version from git tag
if: ${{ github.ref_type == 'tag' }}
run: |
GIT_TAG="${{ github.ref_name }}"
VERSION_NUMBER="${GIT_TAG#v}"
streamdeck pack --output ./build/ --no-update-check --force --version "${VERSION_NUMBER}" com.chrisregado.googlemeet.sdPlugin
- name: Upload final plugin binary
uses: actions/upload-artifact@v4
with:
name: com.chrisregado.googlemeet.streamDeckPlugin
path: ./build/com.chrisregado.googlemeet.streamDeckPlugin