You publish a GitHub release, and the marketplace’s builder builds the extension from that commit, signs it with your key and uploads it together with the commit’s source. Reviewers then read your code, not only binaries, and the marketplace checks that every binary was built from that source. There is no password or API key to store: GitHub gives every run a token that says which repository and workflow it comes from, and the marketplace checks it. Every release still goes through the checks and the review.
- The builder: prusa3d/prusa-connect-marketplace-publish,
the reusable workflow
publish.yml - An extension that publishes this way:
prusa3d/prusa-connect-extension-example.
Its
.github/workflows/release.ymlis the workflow below.
What the builder does
The builder is a reusable workflow, not an action: your workflow calls it and cannot add steps to its jobs, so what runs there is the builder alone.
- The program. It builds every platform under
platforms:inmodule.yamlwithgo build -trimpath, with no cgo, no Makefile and nogo generate, and stamps the commit into every binary. None of your build scripts run here. - The browser bundle, when
module.yamlhas auiblock, is built by yourbundle-commandin a job of its own that gets no secret and no token. Only itsui/is used. - Sign and publish. In your GitHub environment it writes
checksums.txt, signs it with your key, packs the.tar.gz, records a build provenance attestation for the archive and every binary, and uploads the release with the source of the whole repository at that commit (at most 50 MB).
The run’s summary links to the extension in the author console, where the release waits for the review.
Set it up
-
A public repository. The builder records a GitHub build provenance attestation, and GitHub records attestations only for public repositories (or on GitHub Enterprise Cloud). A release from a private repository stops before the upload.
-
A signing key. Create a key pair and register the public key under Signing keys, as in Signing keys. The same keys sign plugins and extensions.
-
A GitHub environment named
releasethat onlyv*tags may deploy to, best with required reviewers (repository settings → Environments). Store the private key there asPRUSA_CONNECT_EXTENSION_SIGNING_KEY:gh secret set PRUSA_CONNECT_EXTENSION_SIGNING_KEY --env release < private_key.pemWhoever has the private key can sign releases as you. Never commit it, keep a backup in a safe place such as a password manager, and if it leaks, revoke it and register a new one.
-
A trusted publisher. Under Trusted publishing in the author console, add:
- the extension id, for example
com.github.aux.acme.spoolsforgithub.com/acme/spools; - the repository,
acme/spools; - the workflow file name,
release.yml; - the environment,
release.
An extension in a GitHub repository can be added before its first release, but only by a repository of the same account:
com.github.aux.acme.…only from a repository ofacme. - the extension id, for example
-
The workflow. Add this file:
name: Publish to Plugin Marketplace on: release: types: [published] jobs: publish: uses: prusa3d/prusa-connect-marketplace-publish/.github/workflows/publish.yml@v1 with: path: . # the extension's folder: module.yaml, go.mod, ui/ bundle-command: make ui-build # what builds the bundle into ui/dist core-ref: main # Prusa Connect into .core/, until the SDK is published secrets: PRUSA_CONNECT_EXTENSION_SIGNING_KEY: ${{ secrets.PRUSA_CONNECT_EXTENSION_SIGNING_KEY }} permissions: contents: read id-token: write # lets the run prove which repository, workflow and builder it is attestations: write # the build provenance of the archive and every binaryPass the key by name as above.
secrets: inherithands secrets only to workflows of your own GitHub organisation, and the builder lives inprusa3d, so with it the key arrives empty.To pin the builder by commit, as some supply-chain rules ask, name the full commit of one of its release tags instead of
@v1, for examplepublish.yml@<40-character sha> # v1.0.0. The marketplace accepts the commit of a release tag of the builder, and nothing else. -
A release. Raise
versioninmodule.yaml, add it toCHANGELOG.md, commit, and publish a GitHub release taggedv<version>. A pre-release goes to the beta channel, and the release notes become the changelog.gh release create v1.2.0 --title "1.2.0" --notes "What changed"
Anyone can check where a release came from:
gh attestation verify spools-1.2.0.tar.gz --repo acme/spools
Several extensions in one repository
Keep each extension in its own folder with its own go.mod, add one trusted publisher per
extension (all with the same repository and workflow), and tag each release with the folder and
the version, for example spools/v1.2.0. Each extension’s id comes from its folder’s go.mod:
jobs:
spools:
if: startsWith(github.ref_name, 'spools/')
uses: prusa3d/prusa-connect-marketplace-publish/.github/workflows/publish.yml@v1
with:
path: extensions/spools
secrets:
PRUSA_CONNECT_EXTENSION_SIGNING_KEY: ${{ secrets.PRUSA_CONNECT_EXTENSION_SIGNING_KEY }}
permissions:
contents: read
id-token: write
attestations: write
labels:
if: startsWith(github.ref_name, 'labels/')
uses: prusa3d/prusa-connect-marketplace-publish/.github/workflows/publish.yml@v1
with:
path: extensions/labels
secrets:
PRUSA_CONNECT_EXTENSION_SIGNING_KEY: ${{ secrets.PRUSA_CONNECT_EXTENSION_SIGNING_KEY }}
permissions:
contents: read
id-token: write
attestations: write
Code the extensions share, such as a package in another folder that go.mod builds in with a
replace, is reviewed as far as the program imports it. A replace that points outside the
repository, or to a folder the repository does not hold, is refused.
Inputs
| Input | Default | What it does |
|---|---|---|
path |
. |
The extension’s folder: module.yaml, go.mod, ui/. |
module |
from go.mod |
The module path the extension id is derived from. |
bundle-command |
cd ui && pnpm install --frozen-lockfile && pnpm run build |
Builds the bundle. It must leave module.yaml and ui/ in bundle-output. |
bundle-output |
ui/dist |
Where bundle-command leaves the release layout, relative to path. |
core-ref |
empty | A branch or tag of Prusa Connect to check out into .core/, while the SDK is not published. |
node-version |
22 |
The Node.js the bundle builds with. |
environment |
release |
The GitHub environment that holds the key. The trusted publisher names it too. |
channel |
auto | stable or beta. Empty: beta for a pre-release, stable otherwise. |
changelog |
release notes | Release notes, Markdown. Empty: the GitHub release body. |
check-version |
true |
For a tag, the tag must end with the version in module.yaml. |
allow-existing |
false |
Treat a version the marketplace already has as success, for re-runs. |
dry-run |
false |
Build, check and sign with a throwaway key, upload nothing. For CI. |
Security
- Keep the key in the
releaseenvironment with required reviewers that onlyv*tags may deploy to. A workflow pushed on some branch then cannot read the key, every publish waits for an approval, and runs outside the environment are refused. - The first release remembers the repository’s numeric GitHub id, so a repository deleted and re-created under the same name by someone else cannot publish.
- The bundle’s build runs your code, so it gets no secret and no token, and the program’s build runs none of it.
- The text an operator reads (
license,title,summary,codeowner, and eachegressentry’swhyandsends) must be plain text: a control character, a line break inside it or an invisible character such as a zero-width space or a direction override is refused.
When it fails
| The run says | What to do |
|---|---|
Failed to persist attestation: Feature not available |
The repository is private. Make it public. |
PRUSA_CONNECT_EXTENSION_SIGNING_KEY is empty (or private-key is empty) |
Store the key with gh secret set PRUSA_CONNECT_EXTENSION_SIGNING_KEY --env release < private_key.pem and pass it by name under secrets: in your workflow, not with secrets: inherit. |
no OIDC token available |
Add id-token: write under permissions of the job that calls the builder. |
tag '...' does not match module.yaml version |
Raise version in module.yaml, or tag the release v<version> (or <folder>/v<version>). |
... is not a trusted publisher of ... |
The repository, workflow file or environment is not the one under Trusted publishing, or the extension id is not added there. |
only a repository of ... can publish its first release |
The module path is in another GitHub account. Publish from a repository of that account, or change the module path. |
ids with "prusa" in them are reserved for Prusa Research |
Choose a module path without “prusa” in it. |
checksums.txt.sig does not verify over checksums.txt against any of your signing keys |
Register the public key of the key in the secret under Signing keys. |
the release is signed with a revoked key (or expired) |
Put an active key in the secret, and its public key under Signing keys. |
... holds U+…, a control or invisible character |
Write that field in module.yaml as plain text. |
the marketplace already has ... |
This version is already uploaded. Raise the version, or set allow-existing: true for a re-run. |
Without the builder
The action alone (uses: prusa3d/prusa-connect-marketplace-publish@v1), which signs and uploads a
release you built yourself, and the author console still
work for now. Such a release carries no source, so its code is not reviewed. Once every extension
publishes through the builder, the marketplace accepts Connect releases from the builder alone.