Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions .github/workflows/marketplace-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ name: Marketplace Build (Reusable)
on:
workflow_call:
inputs:
snapshot_version:
description: "Marketplace snapshot version (not plugin version; used for release naming)"
required: true
type: string
release_tag:
description: "Release tag for bundle URLs and registry PR"
required: true
type: string
registry_base_url:
description: "Registry base URL override"
required: false
Expand All @@ -36,8 +28,6 @@ env:
RUST_BACKTRACE: 1
SHERPA_ONNX_VERSION: "1.12.17"
MINISIGN_DEB_URL: "http://launchpadlibrarian.net/780165111/minisign_0.12-1_amd64.deb"
SNAPSHOT_VERSION: ${{ inputs.snapshot_version }}
RELEASE_TAG: ${{ inputs.release_tag }}
REGISTRY_BASE_URL: ${{ inputs.registry_base_url || 'https://streamkit.dev/registry' }}

jobs:
Expand Down Expand Up @@ -149,11 +139,12 @@ jobs:
python3 scripts/marketplace/build_registry.py \
--plugins marketplace/official-plugins.json \
--existing-registry docs/public/registry \
--bundle-base-url "https://github.com/${{ github.repository }}/releases/download/${RELEASE_TAG}" \
--bundle-url-template "https://github.com/${{ github.repository }}/releases/download/plugin-{plugin_id}-v{version}" \
--registry-base-url "${REGISTRY_BASE_URL}" \
--bundles-out dist/bundles \
--registry-out dist/registry \
--signing-key /tmp/streamkit.key
--signing-key /tmp/streamkit.key \
--new-plugins-out dist/new-plugins.json

- name: Verify marketplace bundle portability
run: |
Expand All @@ -166,6 +157,13 @@ jobs:
with:
name: marketplace-bundles
path: dist/bundles/*.tar.zst
if-no-files-found: ignore

- name: Upload new plugins manifest
uses: actions/upload-artifact@v4
with:
name: new-plugins
path: dist/new-plugins.json

- name: Upload registry metadata
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -225,10 +223,10 @@ jobs:
token: ${{ secrets.REGISTRY_PR_TOKEN || github.token }}
author: "StreamKit Registry Bot <registry-bot@streamkit.dev>"
committer: "StreamKit Registry Bot <registry-bot@streamkit.dev>"
branch: "registry/${{ env.RELEASE_TAG }}-${{ github.run_id }}"
title: "chore(registry): publish marketplace registry for ${{ env.RELEASE_TAG }}"
commit-message: "chore(registry): publish marketplace registry for ${{ env.RELEASE_TAG }}"
branch: "registry/update-${{ github.run_id }}"
title: "chore(registry): publish marketplace registry update"
commit-message: "chore(registry): publish marketplace registry update"
body: |
Automated registry metadata update for `${{ env.RELEASE_TAG }}`.
Automated registry metadata update from run `${{ github.run_id }}`.
delete-branch: true
base: main
102 changes: 73 additions & 29 deletions .github/workflows/marketplace-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,101 @@ name: Marketplace Release
on:
workflow_dispatch:
inputs:
snapshot_version:
description: "Marketplace snapshot version (e.g., 1.2.3, 0.2.0-dev)"
required: true
release_tag:
description: "Release tag (defaults to marketplace-v<snapshot_version>)"
required: false
prerelease:
description: "Mark release as prerelease"
description: "Mark releases as prerelease"
required: false
type: boolean
default: false

env:
RELEASE_TAG: ${{ inputs.release_tag || format('marketplace-v{0}', inputs.snapshot_version) }}

jobs:
marketplace:
uses: ./.github/workflows/marketplace-build.yml
permissions:
contents: write
pull-requests: write
secrets: inherit
with:
snapshot_version: ${{ inputs.snapshot_version }}
release_tag: ${{ inputs.release_tag || format('marketplace-v{0}', inputs.snapshot_version) }}

create-release:
name: Create Marketplace Release
create-releases:
name: Create Per-Plugin Releases
needs: [marketplace]
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v5

- name: Download all artifacts
- name: Download bundles
uses: actions/download-artifact@v4
with:
path: artifacts
name: marketplace-bundles
path: artifacts/bundles

- name: Create Release
uses: softprops/action-gh-release@v2
- name: Download new plugins manifest
uses: actions/download-artifact@v4
with:
tag_name: ${{ env.RELEASE_TAG }}
target_commitish: ${{ github.sha }}
name: "Marketplace ${{ inputs.snapshot_version }}"
files: |
artifacts/**/marketplace-bundles/*.tar.zst
body: |
Marketplace bundles for snapshot `${{ inputs.snapshot_version }}`.
draft: false
prerelease: ${{ inputs.prerelease }}
name: new-plugins
path: artifacts

- name: Load plugin metadata
id: plugins
run: |
if [ ! -f artifacts/new-plugins.json ]; then
echo "No new-plugins.json found"
echo "matrix=[]" >> "$GITHUB_OUTPUT"
exit 0
fi
matrix=$(python3 -c "
import json, sys
data = json.load(open('artifacts/new-plugins.json'))
plugins = data.get('plugins', [])
print(json.dumps(plugins))
")
echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"

- name: Load plugin names
id: names
run: |
names=$(python3 -c "
import json
data = json.load(open('marketplace/official-plugins.json'))
mapping = {p['id']: p.get('name', p['id']) for p in data.get('plugins', [])}
print(json.dumps(mapping))
")
echo "names=${names}" >> "$GITHUB_OUTPUT"

- name: Create per-plugin releases
if: steps.plugins.outputs.matrix != '[]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLUGIN_MATRIX: ${{ steps.plugins.outputs.matrix }}
PLUGIN_NAMES: ${{ steps.names.outputs.names }}
IS_PRERELEASE: ${{ inputs.prerelease }}
run: |
echo "${PLUGIN_MATRIX}" | python3 -c "
import json, os, subprocess, sys

plugins = json.loads(sys.stdin.read())
names = json.loads(os.environ['PLUGIN_NAMES'])
is_prerelease = os.environ.get('IS_PRERELEASE', 'false') == 'true'

for plugin in plugins:
pid = plugin['id']
version = plugin['version']
tag = f'plugin-{pid}-v{version}'
name = names.get(pid, pid)
release_name = f'{name} v{version}'
bundle = f'artifacts/bundles/{pid}-{version}-bundle.tar.zst'

cmd = [
'gh', 'release', 'create', tag,
'--target', os.environ.get('GITHUB_SHA', 'HEAD'),
'--title', release_name,
'--notes', f'Plugin bundle for {name} v{version}.',
bundle,
]
if is_prerelease:
cmd.append('--prerelease')

print(f'Creating release: {tag}')
subprocess.run(cmd, check=True)
"
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ jobs:
contents: write
pull-requests: write
secrets: inherit
with:
snapshot_version: ${{ github.ref_name }}
release_tag: ${{ github.ref_name }}

create-release:
name: Create GitHub Release
Expand Down
79 changes: 78 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading