Shared reusable GitHub Actions workflows for the OBS Studio plugin snaps in
the obs-plugins-snaps organization. The individual plugin snap
repositories call these workflows from their own CI, so each plugin repo
only contains a small caller workflow instead of a full copy of the build
logic.
GitHub requires reusable workflows to live in the .github/workflows/
directory of the repository that hosts them, hence the nested path here.
Packs the snap in the calling repository and uploads it as a build
artifact. The artifact name is prefixed with the plugin_name input so
that artifacts from several plugin snaps can be told apart.
Intended to run on pull requests and pushes to branches other than
main; for releases from main, use release-to-edge.yml instead, which
reuses this workflow to pack the snap.
Inputs:
| Input | Required | Description |
|---|---|---|
plugin_name |
yes | Upstream plugin project name, used in the artifact name |
Builds the snap by calling build-snap.yml, then releases the packed snap
to the latest/edge channel of the Snap Store. Intended to be called on
every push to main, so that edge always tracks the current development
state. Prints the uploaded revisions in the workflow summary.
Inputs:
| Input | Required | Description |
|---|---|---|
plugin_name |
yes | Upstream plugin project name; the snap name is <plugin_name>-obs-studio |
Secrets:
| Secret | Description |
|---|---|
SNAPCRAFT_STORE_EDGE |
Snap Store credentials with permission to upload and release to latest/edge for the snap. |
Promotes already uploaded revisions of the snap to a risk level chosen by
the maintainer (beta, candidate, or stable). Intended to be called
on workflow_dispatch events: the caller declares a workflow_dispatch
trigger with matching inputs and forwards them to this reusable workflow.
GitHub requires write access to dispatch a workflow, so no extra
permission check is needed. The outcome is printed in the workflow
summary.
Inputs:
| Input | Required | Description |
|---|---|---|
plugin_name |
yes | Upstream plugin project name; the snap name is <plugin_name>-obs-studio |
revision |
no | Revision to promote: a store revision number, a comma-separated list of them, or latest (default; the newest revision currently in latest/edge) |
channel |
yes | Target risk level: beta, candidate, or stable |
Secrets:
| Secret | Description |
|---|---|
SNAPCRAFT_STORE_CREDENTIALS |
Snap Store credentials with permission to release the snap to beta, candidate, and stable. |
From a plugin snap repository (as generated by the copier template in
obs-plugins-snaps/template):
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
revision:
description: "Revision (number or 'latest')"
required: false
default: latest
channel:
description: "beta, candidate or stable"
required: true
jobs:
# Pull requests: build only.
build:
if: github.event_name == 'pull_request'
uses: obs-plugins-snaps/workflows/.github/workflows/build-snap.yml@main
with:
plugin_name: "source-record"
# Every commit to main: release to latest/edge.
release:
if: github.event_name == 'push'
uses: obs-plugins-snaps/workflows/.github/workflows/release-to-edge.yml@main
with:
plugin_name: "source-record"
secrets: inherit
# Maintainers promote by running this workflow from the Actions tab.
promote:
if: github.event_name == 'workflow_dispatch'
uses: obs-plugins-snaps/workflows/.github/workflows/promote.yml@main
with:
plugin_name: "source-record"
revision: ${{ inputs.revision }}
channel: ${{ inputs.channel }}
secrets: inheritReusable workflows must be referenced with a full ref (@main above), and
callers cannot add runs-on or steps to the calling job. Because the
workflows above reference store credentials directly, callers must pass
secrets: inherit.