Publishing from CI#
Use CLI 0.1.43+ for this complete workflow. SDK consumers require SDK 0.1.17+ and that compatible CLI, including inside containers and CI.
AgentPM supports noninteractive publication with a PAT and an encrypted author signing key. The package/build commands work with any CI provider; GitHub Actions examples are provided in the examples repository. AgentPM OIDC/keyless trusted publishing remains future work.
Signing credentials#
Keep your existing encrypted StoredKeyV1 JSON record. You can locate it using
agentpm keys list, register its public key with the namespace, and put the
encrypted record in a CI secret. Materialize it as a private temporary file,
then provide its passphrase separately through AGENTPM_KEY_PASSPHRASE:
# AGENTPM_TOKEN and AGENTPM_KEY_PASSPHRASE are supplied by CI secrets.
agentpm publish --namespace your-namespace --sign --key-file "$AUTHOR_KEY_FILE"--key-file selects the encrypted file directly without importing it into the
runner's keystore. Local users can continue using --key-id. The two selectors
are mutually exclusive. Without the passphrase variable, interactive signing
still prompts; a noninteractive process fails with setup guidance instead of
waiting for input. Wrong passphrases and unreadable/invalid key files fail
without printing passphrases, decrypted keys or the explicit private key path.
Do not pass a Registry root key or raw Ed25519 seed as the author key file.
The author public key must be an active trusted signer in the publishing namespace. Explicit signing requires the Registry to confirm an accepted author signature; headless mode also supports namespaces requiring signatures.
Build first, publish once#
- Commit source,
agent.jsonand any prepared Python resolution inagent.lock. - Verify the release tag matches the selected package's manifest version.
- Build/package on each required native runner with
agentpm package --machine. - Transfer each archive and its
package-build.jsonas one build bundle. - After every required build succeeds, gather outputs and invoke
publishonce with all descriptors and required build hosts. - Install the exact published version in a new consumer with
--require-signature --require-attestation, then verify its behavior.
agentpm publish \
--build builds/macos-arm/package-build.json \
--build builds/macos-intel/package-build.json \
--build builds/linux/package-build.json \
--build builds/windows/package-build.json \
--expect-build-target aarch64-apple-darwin \
--expect-build-target x86_64-apple-darwin \
--expect-build-target x86_64-unknown-linux-gnu \
--expect-build-target x86_64-pc-windows-msvc \
--namespace your-namespace --sign --key-file "$AUTHOR_KEY_FILE"That example applies to genuinely concrete-target Python payloads. A portable
Python Tool uses one any build, even when its declared dependencies include
native wheels. Agents and other legacy package kinds use one build and retain
their existing publication/signature formats. See package
for descriptor validation and mixed-target failure behavior.
An Agent, Skill or Template can depend on a newly published Python Tool using the release format. Publication validates access to those dependencies without changing the parent package's format. Install consumers still need a CLI that supports the dependency's release format; older clients receive an upgrade error.
Maintained examples#
The examples repository contains independent release tags/workflows for
summarize-text (Python Tool) and devwork-copilot (Agent), plus a small native
fixture showing a four-runner atomic release (Apple Silicon macOS, Intel macOS,
Linux x86-64 and Windows x64). Windows is a required build and verification
target: publication waits for all four outputs. Linux arm64 is not included.
Package-specific tags select only their intended package. Publishing the Agent does not republish its Tools.
The native example uses one manifest containing a bin/ payload directory.
Windows builds an MSVC x64 native-helper.exe with the static C runtime;
macOS/Linux build native-helper. Compiler intermediates stay outside the
payload. The CLI setup action verifies release checksums and installs the native
Windows ZIP/.exe or Unix .tar.gz asset before packaging and verification.
The repository setup guide documents a pinned compatible CLI version, Registry URL, namespace, protected publishing environment and separate PAT/encrypted key/passphrase secrets. Build jobs have no publication credentials. A separate OpenAI secret is used only for the summarizer's real verification call, which incurs provider usage. Agent verification checks installation and declared Tool versions without requiring SDK execution.
A post-publication verification failure does not remove an already-finalized release. Inspect the failure and use a corrected new version where needed.
GitHub Actions fan-in wiring#
Use a dependency on the entire build job, not a publish step in each matrix runner. The maintained workflow includes a package-specific tag/version guard before any native compilation and pins/checksum-verifies the CLI setup. The core transfer/gating structure is:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-14
target: aarch64-apple-darwin
- os: macos-15-intel
target: x86_64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
# Checkout, verify tag/version, set up CLI and compile native content first.
- run: agentpm package --machine --output bundle
- uses: actions/upload-artifact@v4
with:
name: package-${{ matrix.target }}
path: bundle/
if-no-files-found: error
publish:
needs: build
runs-on: ubuntu-latest
environment: agentpm-publishing
steps:
# Set up CLI before publication.
- uses: actions/download-artifact@v4
with:
pattern: package-*
path: builds/
# Materialize encrypted author key, then run the publish command above.This is the fan-in outline, not a complete standalone workflow. Copy the complete
maintained native workflow
for checkout/setup, native compilation, version guards and post-publish checks.
Its publish job uses normal success gating; do not add an unconditional
always() that permits publishing after a required build fails. Configure the
namespace and Registry URL as variables, and PAT/encrypted key/passphrase as
separate secrets available only to publishing jobs. Clean verification consumers
need their own scoped credentials where package visibility requires them.
Any CI system can implement the same native build → bundle transfer → one
validated publish --build flow. AgentPM does not currently offer OIDC/trusted
publisher authentication; use the scoped PAT and encrypted author-key path.