Skip to content

Commit 0e5390a

Browse files
committed
Migrate to the new Elgato CLI tool
1 parent 1704d67 commit 0e5390a

5 files changed

Lines changed: 523 additions & 478 deletions

File tree

.github/workflows/streamdeck-plugin-build.yml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,24 @@ jobs:
3838
steps:
3939
- name: Check out repository code
4040
uses: actions/checkout@v4
41+
4142
- name: Set up Python
4243
uses: actions/setup-python@v5
4344
with:
4445
python-version: "3.13"
46+
4547
- name: Set up Pip
4648
run: python -m pip install --upgrade pip
49+
4750
- name: pip install
4851
run: pip install -r requirements.txt
52+
4953
- name: Run unit tests
5054
run: python -m unittest
55+
5156
- name: Bundle plugin
5257
run: pyinstaller --clean --dist ../com.chrisregado.googlemeet.sdPlugin/dist/${{ matrix.os }} src/main.py && rm -rf build
58+
5359
- uses: actions/upload-artifact@v4
5460
with:
5561
name: ${{ matrix.os }}-plugin-intermediate-build
@@ -65,26 +71,47 @@ jobs:
6571
steps:
6672
- name: Check out repository code
6773
uses: actions/checkout@v4
68-
- name: Download DistributionTool
69-
run: curl -L https://github.com/ChrisRegado/streamdeck-build-tools/raw/master/DistributionToolMac/DistributionTool -o DistributionTool
70-
- name: Make DistributionTool Executable
71-
run: chmod +x DistributionTool
74+
75+
- name: Set up Node.js
76+
uses: actions/setup-node@v4
77+
with:
78+
# See https://docs.elgato.com/streamdeck/cli/intro/ for supported Node.js versions
79+
node-version: '22'
80+
81+
- name: Install Elgato streamdeck CLI tool
82+
run: npm install -g @elgato/cli@1.5.0
83+
7284
- name: Download macOS plugin artifact
7385
uses: actions/download-artifact@v4
7486
with:
7587
name: macos-plugin-intermediate-build
7688
path: com.chrisregado.googlemeet.sdPlugin/dist/macos
89+
7790
- name: Download Windows plugin artifact
7891
uses: actions/download-artifact@v4
7992
with:
8093
name: windows-plugin-intermediate-build
8194
path: com.chrisregado.googlemeet.sdPlugin/dist/windows
95+
96+
- name: Run Elgato linter
97+
run: streamdeck validate --no-update-check com.chrisregado.googlemeet.sdPlugin
98+
8299
- name: Make output dir
83-
run: mkdir output
100+
run: mkdir ./build
101+
84102
- name: Bundle plugin
85-
run: ./DistributionTool -b -i ./com.chrisregado.googlemeet.sdPlugin -o output/
103+
if: ${{ github.ref_type != 'tag' }}
104+
run: streamdeck pack --output ./build/ --no-update-check com.chrisregado.googlemeet.sdPlugin
105+
106+
- name: Bundle plugin using version from git tag
107+
if: ${{ github.ref_type == 'tag' }}
108+
run: |
109+
GIT_TAG="${{ github.ref_name }}"
110+
VERSION_NUMBER="${GIT_TAG#v}"
111+
streamdeck pack --output ./build/ --no-update-check --force --version "${VERSION_NUMBER}" com.chrisregado.googlemeet.sdPlugin
112+
86113
- name: Upload final plugin binary
87114
uses: actions/upload-artifact@v4
88115
with:
89116
name: com.chrisregado.googlemeet.streamDeckPlugin
90-
path: output/com.chrisregado.googlemeet.streamDeckPlugin
117+
path: ./build/com.chrisregado.googlemeet.streamDeckPlugin

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ dmypy.json
145145
DistributionTool.exe
146146
DistributionTool
147147
com.chrisregado.googlemeet.streamDeckPlugin
148+
node_modules
148149

149150
# Browser extension build artifacts
150151
browser-extension/build/

README.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ In the Stream Deck desktop app, right click on one of the Google Meet actions in
5959

6060
The Stream Deck plugin launches a localhost-only Websocket server on port 2394, which our browser extension connects to. The plugin and browser extension send messages back and forth over that websocket to notify the Stream Deck when Meet changes its device on/off status, and simulates Meet mute button clicks in your browser when you press a key on your Stream Deck.
6161

62-
The Stream Deck plugin code is in the `streamdeck-plugin` directory. The browser extension code is in the `browser-extension` directory. The `com.chrisregado.googlemeet.sdPlugin` directory contains our Stream Deck assets and it becomes our Stream Deck plugin distributable once we bundle our code with the Elgato DistributionTool.
62+
The Stream Deck plugin code is in the `streamdeck-plugin` directory. The browser extension code is in the `browser-extension` directory. The `com.chrisregado.googlemeet.sdPlugin` directory contains our Stream Deck assets and it becomes our Stream Deck plugin distributable once we bundle our code with the Elgato `streamdeck` CLI.
6363

6464
## Developing the Stream Deck Plugin
6565

6666
### First Time Setup
6767

6868
The plugin is written in Python. Create a venv to hold your package's dependencies, and install those dependencies:
6969

70-
MacOS:
70+
**MacOS:**
7171

7272
```
7373
cd streamdeck-plugin
@@ -76,7 +76,7 @@ source venv/bin/activate
7676
pip install -r requirements.txt
7777
```
7878

79-
Windows:
79+
**Windows:**
8080

8181
```
8282
cd streamdeck-plugin
@@ -89,15 +89,15 @@ Remember that virtualenvs are not portable. If you move this folder at all, you'
8989

9090
### Running Unit Tests
9191

92-
MacOS:
92+
**MacOS:**
9393

9494
```
9595
cd streamdeck-plugin
9696
source venv/bin/activate
9797
python -m unittest
9898
```
9999

100-
Windows:
100+
**Windows:**
101101

102102
```
103103
cd streamdeck-plugin
@@ -107,11 +107,13 @@ python -m unittest
107107

108108
### Bundling
109109

110-
We use `pyinstaller` to bundle our code, dependencies, and a Python runtime environment into an executable. We put that executable into the `com.chrisregado.googlemeet.sdPlugin` folder, which in turn gets zipped up by the [Elgato DistributionTool](https://developer.elgato.com/documentation/stream-deck/sdk/packaging/) as our final distributable plugin package. That plugin package ends up including any assets we need (e.g. icons), the `manifest.json` file that defines our plugin for the Stream Deck desktop app, and our executable plugin code. Double-click that plugin package and the Stream Deck software will prompt you to install it.
110+
We use `pyinstaller` to bundle our code, dependencies, and a Python runtime environment into an executable. We put that executable into the `com.chrisregado.googlemeet.sdPlugin` folder, which in turn gets zipped up by the [Elgato streamdeck CLI tool](https://docs.elgato.com/streamdeck/cli/intro) as our final distributable plugin package. That plugin package ends up including any assets we need (e.g. icons), the `manifest.json` file that defines our plugin for the Stream Deck desktop app, and our executable plugin code. Double-click that plugin package and the Stream Deck software will prompt you to install it.
111111

112-
To build the bundle:
112+
Our plugin code is written in Python, but the Elgato CLI tool is distributed as a Node module, so you'll need Node.js installed.
113113

114-
MacOS:
114+
To build the plugin:
115+
116+
**MacOS:**
115117

116118
```
117119
cd streamdeck-plugin
@@ -121,7 +123,7 @@ pyinstaller --clean --dist "../com.chrisregado.googlemeet.sdPlugin/dist/macos" s
121123
rm -rf build
122124
```
123125

124-
Windows:
126+
**Windows:**
125127

126128
```
127129
cd streamdeck-plugin
@@ -133,23 +135,36 @@ rmdir /q /s build
133135

134136
Note that the resulting executable is only valid for the OS you built it on. MacOS and Windows bundles must be created separately from a machine/VM of that OS, and then combined into the `com.chrisregado.googlemeet.sdPlugin/dist/` folder with `macos` and `windows` subdirectories for release.
135137

136-
If you're just testing locally (so you only care about one OS), you can place any file in the other OS's executable location (`CodePath`s from `manifest.json`) to appease the Elgato DistributionTool. Example:
138+
If you're just testing locally (so you only care about one OS), you can place any file in the other OS's executable location (`CodePath`s from `manifest.json`) to appease the Elgato packaging tool. Example:
137139

138140
```
141+
# If you're running macOS:
139142
mkdir -p com.chrisregado.googlemeet.sdPlugin/dist/windows/main
140143
touch com.chrisregado.googlemeet.sdPlugin/dist/windows/main/main.exe
144+
145+
# If you're running Windows:
146+
mkdir com.chrisregado.googlemeet.sdPlugin\dist\macos\main
147+
type nul > com.chrisregado.googlemeet.sdPlugin\dist\macos\main\main
141148
```
142149

143150
Or, if you don't ever plan on publishing your local builds, delete the other OS's CodePath and `OS` entry in manifest.json so you don't have to worry about multi-OS support.
144151

145-
Finally, use the DistributionTool to bundle everything into the Stream Deck plugin distributable that you can send to users:
152+
Finally, use Elgato's `streamdeck` CLI tool to bundle everything into the Stream Deck plugin distributable that you can install or send to users. From the root of this git repo, run:
146153

147154
```
148-
./DistributionTool -b -i ./com.chrisregado.googlemeet.sdPlugin -o ~/Desktop/
155+
npm install -g @elgato/cli
156+
157+
streamdeck pack --output ./build/ --force com.chrisregado.googlemeet.sdPlugin
149158
```
150159

160+
In the Stream Deck desktop app, uninstall any old copies of the plugin because the app won't overwrite your installation unless the new build has a newer version number.
161+
162+
You can then double-click the `./build/com.chrisregado.googlemeet.streamDeckPlugin` file to install your build of the plugin into the Stream Deck desktop app.
163+
151164
## Developing the Browser Extension
152165

166+
Our build tools rely on Node.js, so make sure you have Node.js installed.
167+
153168
### Using Google Chrome
154169

155170
Follow the usual "Load unpacked" installation instructions described above, but point Chrome at the `browser-extension` folder of your git workspace instead of using a release artifact. You can then edit the extension's source code and click the reload button on Chrome's extension settings page. (No build commands/steps are needed.) See https://developer.chrome.com/extensions/getstarted for more details.

RELEASE_INSTRUCTIONS.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ Finally, we'll add auth tokens from the Firefox Add-on portal as GitHub Action s
3434

3535
Follow these steps each time you want to release a new version of the plugin and/or browser extension:
3636

37-
1. Manually update the version number of the Stream Deck plugin by editing `com.chrisregado.googlemeet.sdPlugin/manifest.json` and changing the `Version` field. Make sure that change gets merged into `master`. (We have CI jobs to manage version numbers for the browser extensions, so you don't need to touch those.)
38-
2. Tag the commit you wish to release and push it to GitHub. We use semantic versioning with a "v" prefix for our releases. For example: `git checkout master && git tag v1.2.3 && git push origin tag v1.2.3`
39-
3. CI jobs should automatically launch against that tag to build the [Stream Deck plugin](https://github.com/ChrisRegado/streamdeck-googlemeet/actions/workflows/streamdeck-plugin-build.yml) and [browser extensions](https://github.com/ChrisRegado/streamdeck-googlemeet/actions/workflows/browser-extension-build.yml). (The list of workflow runs should show one copy of each of those two jobs with your `v1.2.3` tag.) Wait for them to complete successfully.
40-
4. Click into those two build jobs, and on each job's "Summary" tab, download our build artifacts. The browser extension build job should have `chrome-extension` and `firefox-extension-signed` artifacts, and the plugin build job should have `com.chrisregado.googlemeet.streamDeckPlugin`.
41-
5. Do a final manual validation of those release artifacts. Install the plugin, Firefox extension, and Chrome extension, and verify basic functionality.
42-
6. On the Github page for your repo, click "Releases". (https://github.com/ChrisRegado/streamdeck-googlemeet/releases)
43-
7. Click "Draft a new release".
44-
8. Click the "Tag" button and select the tag you made in the previous step.
45-
9. Use the your tag name as the "Release title", and enter a description summarizing notable changes in this release.
46-
10. Select the "Set as a pre-release" checkbox near the bottom of the page.
47-
11. Click "Publish release".
48-
12. Our [release CI job](https://github.com/ChrisRegado/streamdeck-googlemeet/actions/workflows/release.yaml) should automatically start and attach our tag's artifacts to the GitHub Release. Wait for it to complete. If all goes well, in a minute or two you should see 3 attachments appear on the release: the `com.chrisregado.googlemeet.streamDeckPlugin` plugin, a zip of the Chrome extension, and an `.xpi` file for the Firefox extension.
49-
13. Edit the release, uncheck the "Set as a pre-release" checkbox at the bottom of the page, select the "Set as the latest release" checkbox, and click "Update release".
37+
1. Tag the commit you wish to release and push it to GitHub. We use semantic versioning with a "v" prefix for our releases. For example: `git checkout master && git tag v1.2.3 && git push origin tag v1.2.3`
38+
* Our CI jobs will update version numbers automatically to match that tag for both the plugin and browser extensions. You don't need to manually change any version numbers in code/config.
39+
2. CI jobs should automatically launch against that tag to build the [Stream Deck plugin](https://github.com/ChrisRegado/streamdeck-googlemeet/actions/workflows/streamdeck-plugin-build.yml) and [browser extensions](https://github.com/ChrisRegado/streamdeck-googlemeet/actions/workflows/browser-extension-build.yml). (The list of workflow runs should show one copy of each of those two jobs with your `v1.2.3` tag.) Wait for them to complete successfully.
40+
3. Click into those two build jobs, and on each job's "Summary" tab, download our build artifacts. The browser extension build job should have `chrome-extension` and `firefox-extension-signed` artifacts, and the plugin build job should have `com.chrisregado.googlemeet.streamDeckPlugin`.
41+
4. Do a final manual validation of those release artifacts. Install the plugin, Firefox extension, and Chrome extension, and verify basic functionality.
42+
5. On the Github page for your repo, click "Releases". (https://github.com/ChrisRegado/streamdeck-googlemeet/releases)
43+
6. Click "Draft a new release".
44+
7. Click the "Tag" button and select the tag you made in the previous step.
45+
8. Use the your tag name as the "Release title", and enter a description summarizing notable changes in this release.
46+
9. Select the "Set as a pre-release" checkbox near the bottom of the page.
47+
10. Click "Publish release".
48+
11. Our [release CI job](https://github.com/ChrisRegado/streamdeck-googlemeet/actions/workflows/release.yaml) should automatically start and attach our tag's artifacts to the GitHub Release. Wait for it to complete. If all goes well, in a minute or two you should see 3 attachments appear on the release: the `com.chrisregado.googlemeet.streamDeckPlugin` plugin, a zip of the Chrome extension, and an `.xpi` file for the Firefox extension.
49+
12. Edit the release, uncheck the "Set as a pre-release" checkbox at the bottom of the page, select the "Set as the latest release" checkbox, and click "Update release".

0 commit comments

Comments
 (0)