Skip to content

Commit d58c3c3

Browse files
authored
feat: plugin marketplace (#44)
* feat: plugin marketplace * chore: update sample config * chore: use official repo for model downloads * feat(marketplace): per-plugin release tags and embed manifest in bundles * fix(ui): tweaks * fix(ui): more tweaks
1 parent 9548c98 commit d58c3c3

File tree

104 files changed

+10214
-1821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+10214
-1821
lines changed

.github/workflows/marketplace-build.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ name: Marketplace Build (Reusable)
77
on:
88
workflow_call:
99
inputs:
10-
snapshot_version:
11-
description: "Marketplace snapshot version (not plugin version; used for release naming)"
12-
required: true
13-
type: string
14-
release_tag:
15-
description: "Release tag for bundle URLs and registry PR"
16-
required: true
17-
type: string
1810
registry_base_url:
1911
description: "Registry base URL override"
2012
required: false
@@ -36,8 +28,6 @@ env:
3628
RUST_BACKTRACE: 1
3729
SHERPA_ONNX_VERSION: "1.12.17"
3830
MINISIGN_DEB_URL: "http://launchpadlibrarian.net/780165111/minisign_0.12-1_amd64.deb"
39-
SNAPSHOT_VERSION: ${{ inputs.snapshot_version }}
40-
RELEASE_TAG: ${{ inputs.release_tag }}
4131
REGISTRY_BASE_URL: ${{ inputs.registry_base_url || 'https://streamkit.dev/registry' }}
4232

4333
jobs:
@@ -149,11 +139,12 @@ jobs:
149139
python3 scripts/marketplace/build_registry.py \
150140
--plugins marketplace/official-plugins.json \
151141
--existing-registry docs/public/registry \
152-
--bundle-base-url "https://github.com/${{ github.repository }}/releases/download/${RELEASE_TAG}" \
142+
--bundle-url-template "https://github.com/${{ github.repository }}/releases/download/plugin-{plugin_id}-v{version}" \
153143
--registry-base-url "${REGISTRY_BASE_URL}" \
154144
--bundles-out dist/bundles \
155145
--registry-out dist/registry \
156-
--signing-key /tmp/streamkit.key
146+
--signing-key /tmp/streamkit.key \
147+
--new-plugins-out dist/new-plugins.json
157148
158149
- name: Verify marketplace bundle portability
159150
run: |
@@ -166,6 +157,13 @@ jobs:
166157
with:
167158
name: marketplace-bundles
168159
path: dist/bundles/*.tar.zst
160+
if-no-files-found: ignore
161+
162+
- name: Upload new plugins manifest
163+
uses: actions/upload-artifact@v4
164+
with:
165+
name: new-plugins
166+
path: dist/new-plugins.json
169167

170168
- name: Upload registry metadata
171169
uses: actions/upload-artifact@v4
@@ -225,10 +223,10 @@ jobs:
225223
token: ${{ secrets.REGISTRY_PR_TOKEN || github.token }}
226224
author: "StreamKit Registry Bot <registry-bot@streamkit.dev>"
227225
committer: "StreamKit Registry Bot <registry-bot@streamkit.dev>"
228-
branch: "registry/${{ env.RELEASE_TAG }}-${{ github.run_id }}"
229-
title: "chore(registry): publish marketplace registry for ${{ env.RELEASE_TAG }}"
230-
commit-message: "chore(registry): publish marketplace registry for ${{ env.RELEASE_TAG }}"
226+
branch: "registry/update-${{ github.run_id }}"
227+
title: "chore(registry): publish marketplace registry update"
228+
commit-message: "chore(registry): publish marketplace registry update"
231229
body: |
232-
Automated registry metadata update for `${{ env.RELEASE_TAG }}`.
230+
Automated registry metadata update from run `${{ github.run_id }}`.
233231
delete-branch: true
234232
base: main

.github/workflows/marketplace-release.yml

Lines changed: 73 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,101 @@ name: Marketplace Release
77
on:
88
workflow_dispatch:
99
inputs:
10-
snapshot_version:
11-
description: "Marketplace snapshot version (e.g., 1.2.3, 0.2.0-dev)"
12-
required: true
13-
release_tag:
14-
description: "Release tag (defaults to marketplace-v<snapshot_version>)"
15-
required: false
1610
prerelease:
17-
description: "Mark release as prerelease"
11+
description: "Mark releases as prerelease"
1812
required: false
1913
type: boolean
2014
default: false
2115

22-
env:
23-
RELEASE_TAG: ${{ inputs.release_tag || format('marketplace-v{0}', inputs.snapshot_version) }}
24-
2516
jobs:
2617
marketplace:
2718
uses: ./.github/workflows/marketplace-build.yml
2819
permissions:
2920
contents: write
3021
pull-requests: write
3122
secrets: inherit
32-
with:
33-
snapshot_version: ${{ inputs.snapshot_version }}
34-
release_tag: ${{ inputs.release_tag || format('marketplace-v{0}', inputs.snapshot_version) }}
3523

36-
create-release:
37-
name: Create Marketplace Release
24+
create-releases:
25+
name: Create Per-Plugin Releases
3826
needs: [marketplace]
3927
runs-on: ubuntu-22.04
4028
permissions:
4129
contents: write
4230
steps:
4331
- uses: actions/checkout@v5
4432

45-
- name: Download all artifacts
33+
- name: Download bundles
4634
uses: actions/download-artifact@v4
4735
with:
48-
path: artifacts
36+
name: marketplace-bundles
37+
path: artifacts/bundles
4938

50-
- name: Create Release
51-
uses: softprops/action-gh-release@v2
39+
- name: Download new plugins manifest
40+
uses: actions/download-artifact@v4
5241
with:
53-
tag_name: ${{ env.RELEASE_TAG }}
54-
target_commitish: ${{ github.sha }}
55-
name: "Marketplace ${{ inputs.snapshot_version }}"
56-
files: |
57-
artifacts/**/marketplace-bundles/*.tar.zst
58-
body: |
59-
Marketplace bundles for snapshot `${{ inputs.snapshot_version }}`.
60-
draft: false
61-
prerelease: ${{ inputs.prerelease }}
42+
name: new-plugins
43+
path: artifacts
44+
45+
- name: Load plugin metadata
46+
id: plugins
47+
run: |
48+
if [ ! -f artifacts/new-plugins.json ]; then
49+
echo "No new-plugins.json found"
50+
echo "matrix=[]" >> "$GITHUB_OUTPUT"
51+
exit 0
52+
fi
53+
matrix=$(python3 -c "
54+
import json, sys
55+
data = json.load(open('artifacts/new-plugins.json'))
56+
plugins = data.get('plugins', [])
57+
print(json.dumps(plugins))
58+
")
59+
echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"
60+
61+
- name: Load plugin names
62+
id: names
63+
run: |
64+
names=$(python3 -c "
65+
import json
66+
data = json.load(open('marketplace/official-plugins.json'))
67+
mapping = {p['id']: p.get('name', p['id']) for p in data.get('plugins', [])}
68+
print(json.dumps(mapping))
69+
")
70+
echo "names=${names}" >> "$GITHUB_OUTPUT"
71+
72+
- name: Create per-plugin releases
73+
if: steps.plugins.outputs.matrix != '[]'
6274
env:
63-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
PLUGIN_MATRIX: ${{ steps.plugins.outputs.matrix }}
77+
PLUGIN_NAMES: ${{ steps.names.outputs.names }}
78+
IS_PRERELEASE: ${{ inputs.prerelease }}
79+
run: |
80+
echo "${PLUGIN_MATRIX}" | python3 -c "
81+
import json, os, subprocess, sys
82+
83+
plugins = json.loads(sys.stdin.read())
84+
names = json.loads(os.environ['PLUGIN_NAMES'])
85+
is_prerelease = os.environ.get('IS_PRERELEASE', 'false') == 'true'
86+
87+
for plugin in plugins:
88+
pid = plugin['id']
89+
version = plugin['version']
90+
tag = f'plugin-{pid}-v{version}'
91+
name = names.get(pid, pid)
92+
release_name = f'{name} v{version}'
93+
bundle = f'artifacts/bundles/{pid}-{version}-bundle.tar.zst'
94+
95+
cmd = [
96+
'gh', 'release', 'create', tag,
97+
'--target', os.environ.get('GITHUB_SHA', 'HEAD'),
98+
'--title', release_name,
99+
'--notes', f'Plugin bundle for {name} v{version}.',
100+
bundle,
101+
]
102+
if is_prerelease:
103+
cmd.append('--prerelease')
104+
105+
print(f'Creating release: {tag}')
106+
subprocess.run(cmd, check=True)
107+
"

.github/workflows/release.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ jobs:
8686
contents: write
8787
pull-requests: write
8888
secrets: inherit
89-
with:
90-
snapshot_version: ${{ github.ref_name }}
91-
release_tag: ${{ github.ref_name }}
9289

9390
create-release:
9491
name: Create GitHub Release

Cargo.lock

Lines changed: 78 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)