GitHub Actions Publishing to GHCR
This guide shows how to automate publishing an individual JetPack worker application to GitHub Container Registry (ghcr.io) using jetpack / jetpack-daemon and oras, then verify the remote manifest_sha256 digest required by catalog.signed.json.
A ready-to-copy workflow file is included in the repository at examples/publish-app-ghcr.yml.
1. Prerequisites
- A repository containing a valid JetPack worker (
app.toml,worker.pyor native binary, and optional builtui/bundle). - GitHub Actions permissions with
packages: writeso${{ secrets.GITHUB_TOKEN }}can push OCI manifests and blobs toghcr.io. - Public package visibility: JetPack Store installs pull from
ghcr.iousing anonymous Bearer token exchange (https://ghcr.io/token). After the first push, open the package settings on GitHub (https://github.com/users/<owner>/packages/container/<package>/settingsor your organization's Packages settings) and set visibility to Public sojetpack-daemoncan pull it on end-user machines without credentials.
2. Workflow Walkthrough
Validate
app.toml:bashjetpack validate ./app.tomlPackage an ORAS-compatible OCI Image Layout v1.0.0 bundle:
bashjetpack package . --out ./dist/oci --oci-ref ghcr.io/your-org/my-worker:0.1.0jetpack packagewritesoci-layout,blobs/sha256/*, and rootindex.jsonwith"org.opencontainers.image.ref.name": "0.1.0"pointing to either:- the multi-arch
OciImageIndexblob (application/vnd.oci.image.index.v1+json) when[hardware].architectureslists multiple platforms, or - the single-arch
OciImageManifestblob (application/vnd.oci.image.manifest.v1+json) when one architecture is declared.
It also prints the exact
manifest_sha256, theoras cp --from-oci-layoutpush command, and theoras manifest fetch --descriptorverification command.- the multi-arch
Push to
ghcr.iowithoras:bashecho "${{ secrets.GITHUB_TOKEN }}" | oras login ghcr.io -u "${{ github.actor }}" --password-stdin oras cp --from-oci-layout ./dist/oci:0.1.0 ghcr.io/your-org/my-worker:0.1.0Verify the live remote digest:
bashoras manifest fetch --descriptor ghcr.io/your-org/my-worker:0.1.0Confirm the returned
digestequalsmanifest_sha256fromjetpack packagebefore submitting yourCatalogAppEntryto Store Submission & Catalog Signing.Run the live end-to-end pull smoke test (once the GHCR package is Public):
bashjetpack-daemon \ --oci-remote-smoke-test ghcr.io/your-org/my-worker:0.1.0 \ --expected-digest sha256:<64-hex>This verifies anonymous
ghcr.io/tokenBearer negotiation, multi-arch platform selection,307CDN blob streaming,SHA-256CAS commit, and Tar-Slip-safe unpacking in an isolated temporary directory.
3. Complete Workflow Template (examples/publish-app-ghcr.yml)
name: Publish JetPack App to GHCR
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
package-and-publish-ghcr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oras-project/setup-oras@v1
with:
version: "1.2.2"
- uses: dtolnay/rust-toolchain@stable
- name: Install JetPack CLI & Daemon
run: |
cargo install --locked --git https://github.com/jetpack-desktop/jetpack.git jetpack-cli jetpack-daemon
- name: Validate & Package OCI Layout
id: pkg
run: |
TAG="${GITHUB_REF_NAME#v}"
OCI_REF="ghcr.io/$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]'):${TAG}"
jetpack validate ./app.toml
OUT="$(jetpack package . --out ./dist/oci --oci-ref "${OCI_REF}")"
echo "${OUT}"
echo "tag=${TAG}" >> "${GITHUB_OUTPUT}"
echo "oci_ref=${OCI_REF}" >> "${GITHUB_OUTPUT}"
echo "digest=$(echo "${OUT}" | awk '/manifest_sha256:/ {print $2; exit}')" >> "${GITHUB_OUTPUT}"
- name: Push to GHCR & Verify Digest
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | oras login ghcr.io -u "${{ github.actor }}" --password-stdin
oras cp --from-oci-layout "./dist/oci:${{ steps.pkg.outputs.tag }}" "${{ steps.pkg.outputs.oci_ref }}"
REMOTE_DIGEST="$(oras manifest fetch --descriptor "${{ steps.pkg.outputs.oci_ref }}" | jq -r '.digest')"
test "${REMOTE_DIGEST}" = "${{ steps.pkg.outputs.digest }}"See also CLI Tools Reference and Store Submission & Catalog Signing.
