Skip to content

Publishing packages

A package project is an ordinary bino project whose bino.toml carries a [package] table. It is authored in git like any other project - you preview it, lint it, and review it in pull requests - and bino publish ships it to a registry as an immutable version.

There is no second manifest file and no separate project type: the presence of [package] is what makes a project publishable.

bino init predef -d finance-kit
cd finance-kit

The wizard asks for the registry scope, package name, description, visibility, tags and category and writes them into the [package] table. Every namespaced manifest already carries @scope/name, so there is nothing to search and replace afterwards. Non-interactive runs pass the same values with --set, for example --set Scope=myorg --set Visibility=public -y.

The scaffold is a working example rather than a skeleton:

finance-kit/
├── bino.toml                    # engine pin, [package], [dependencies]
├── components/revenue_table.yaml
├── styles/corporate_theme.yaml
├── resources/logo.yaml          # an Asset
├── resources/logo.png           # the bytes it points at
└── mocks/                       # sample data + a page, so you can preview it

mocks/ is the convention that makes a package previewable without a consumer: it holds a dataset and a small report page that renders the package’s definitions. It is never part of a published package, so bino preview works out of the box and the mock data never leaves your repository.

engine-version = "1.2.3"

[package]
name        = "@acme/finance-kit"   # the registry coordinate
description = "IBCS finance report building blocks"
tags        = ["finance", "ibcs"]
category    = "components"
visibility  = "private"             # only used when the package is created
license     = "MIT"                 # SPDX expression, "UNLICENSED" or "SEE LICENSE IN <file>"

# Warn-only semver ranges, reported to consumers on install:
compat-engine = ">=1.2.0"
compat-cli    = ">=0.92.0"

# Which files ship. The default is every canonical manifest folder plus
# resources/, minus mocks/, reports/ and .bino/.
include = ["components", "styles", "resources"]

# What the registry snapshots for its preview: "path#definition-name".
preview = "components/waterfall.yaml#@acme/finance-kit/waterfall"

[dependencies]                      # the same table a report project uses
"@acme/base-style" = "2.1.0"

visibility only takes effect when the package is created. Without it the package is created private, and bino publish says so on the first publish. Afterwards the registry owns it - change it in the web UI, not here.

license is an SPDX license expression (MIT, Apache-2.0 OR MIT, LicenseRef-acme), UNLICENSED for all rights reserved, or SEE LICENSE IN <file>. The registry validates it and shows it on the package page. bino publish warns when it is missing.

Every document a package ships must be named under the package:

  • @acme/finance-kit - the package’s main definition, at most one;
  • @acme/finance-kit/waterfall - any other definition.

Consumers reference either form with an ordinary ref. bino lint checks this along with the rest of the package ruleset, which activates automatically when [package] is present:

bino lint

It flags definitions named outside the package, artefact and credential kinds that cannot be published, absolute localPath values, and refs to names that are neither in the package nor a declared dependency.

Documents .yaml / .yml manifests. One file may hold several ----separated definitions.
Resources .png, .jpg, .jpeg, .webp, .gif, .svg, .csv, .xlsx, .parquet (SVG: no script, max 5 MB)
Layout At most one directory level - components/waterfall.yaml is fine, components/tables/waterfall.yaml is not
Size 50 files, 1 MB per manifest, 50 MB per resource

Two things are refused before anything is uploaded, whatever include says: anything under secrets/ or signing/, and any document declaring a ConnectionSecret or SigningProfile. Symbolic links are refused too - the file you see would not be the file that ships.

bino registry login          # once, with a bino_pat_ token from the web UI
bino publish --dry-run       # validate against the registry, mint nothing
bino publish --bump minor

--bump is patch, minor or major; the registry mints the version from it (the first publish is always 1.0.0). bino publish refuses to run without --bump unless --dry-run is set. Use --json for a machine-readable result.

The registry is the validation authority. bino publish runs your local lint first and prints what it finds, but a package that lints clean can still be rejected - the registry validates the uploaded tree with its own bino and engine. When it does reject, the output names both versions:

✗ The registry rejected this package:
  • components/waterfall.yaml:12: [error] unknown field "colour" (schema-validation)

ℹ validated by bino 0.92.5 / engine 1.4.0 (registry)
ℹ             bino 0.94.0 / engine 1.5.0 (here)

A gap between those two lines is the usual explanation for a package that is valid locally and invalid remotely.

Publishing the same content twice is not an error. The registry recognises the identical file manifest and reports the version that already carries it:

✓ @acme/finance-kit is unchanged - already published as 1.3.0

That makes a re-run of a CI job safe, so publishing on a tag is a two-line step:

export BINO_REGISTRY_TOKEN="bino_pat_..."
bino publish --bump patch

Versions are immutable and there is no unpublish. --dry-run is worth the extra minute in a pipeline that publishes automatically.

On GitHub Actions you can skip the token secret: see Trusted Publishing.

From bino v0.120.0, a GitHub Actions job can publish without a personal access token. The scope owner names the repository and workflow that may publish, and bino proves it is that workflow with the job’s OIDC token:

  1. bino asks GitHub for an OIDC token whose audience is the registry’s URL.
  2. The registry checks the token and looks for a matching trusted publisher of the package’s scope.
  3. It answers with a token that may only publish this one package, for 15 minutes. bino publishes with it, dry run included.

Nothing long-lived is stored in the repository, and the version records the repository, workflow, ref, commit and run it was published from.

A scope owner adds it on the registry, on the scope’s page under the signing settings, Trusted publishers:

Field Value
Issuer GitHub Actions (https://token.actions.githubusercontent.com), the only one
Repository owner/repo, for example acme/reports
Workflow the workflow file’s path, for example .github/workflows/publish.yml
Ref an exact ref such as refs/heads/main or refs/tags/v1.2.0, or empty for any ref
Package a package name in the scope, or empty for every package of the scope

Every trusted publisher is a publish grant for the scope. With an empty ref, anyone who can push a branch carrying that workflow file can publish, so set a ref and a package where you can. Only jobs for a branch or a tag publish; a pull request job never does.

On the first publish the registry records the repository’s GitHub ids. If the repository is deleted and someone creates a new one under the same name, the registry refuses it. To trust a repository under that name again, remove its trusted publishers, save, and add them back.

name: publish
on:
  push:
    tags: ["v*"]

permissions:
  contents: read
  id-token: write # lets bino request OIDC tokens

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install bino
        run: /bin/bash -c "$(curl -fsSL https://github.com/bino-bi/bino-cli-releases/releases/latest/download/install.sh)"
      - name: Publish
        run: bino publish --bump patch --sign --keyless

There is no BINO_REGISTRY_TOKEN. bino uses Trusted Publishing when the job can request OIDC tokens and no registry token is configured (in bino.toml, in BINO_REGISTRY_TOKEN or from bino registry login). A configured token wins, so add --trusted-publishing to use Trusted Publishing anyway.

The publish token only works for publishing, so bino checks whether the package exists without it and cannot see a private package. Keep [package].visibility equal to the package’s visibility, or leave it out after the first publish; a value that differs is refused by the registry.

--sign --keyless asks GitHub for a second OIDC token, for Sigstore. The signature then names the publish channel oidc and the run, as the Sigstore certificate states it. --sign is optional; Trusted Publishing also works for unsigned publishes and for --sign --key. Keyless signing only works for public packages.

When the exchange fails, bino publish stops and says why:

  • no trusted publisher matches: add the repository, workflow and ref as a trusted publisher of the scope, or fix the ones you added. If the registry says Trusted Publishing is not configured, its operator has to turn it on.
  • the registry does not support Trusted Publishing: the registry is too old. Publish with a token instead.
  • invalid token: the job is not for a branch or a tag (for example a pull request), or the token is not for this registry.

From bino v0.117.0, bino publish --sign signs the release, so consumers can require it with a [trust] policy and see who published it. The signature covers the package name, the version and the digest of the file manifest.

bino first runs a dry run to learn the version the registry will mint and its digest, checks the digest is the one it computed itself, signs both, and then publishes with the signature. If another version is published between the two steps, the registry refuses the signature; run bino publish again. A registry without signature support is refused before anything is signed.

There are three ways to sign:

Flags Signer Consumers trust it with
--sign --keyless the CI workflow, through Sigstore oidc-issuer + repository + workflow
--sign --key k.pem a long-lived key key-file (and key)
--sign --key k.pem --cert-chain c.pem a certificate from a company CA x509-root (and identity)
  • --keyless gets a short-lived certificate from the public Sigstore and writes the signature to its public transparency log (Rekor). Anyone can read that log, so bino refuses --keyless for a package that is not public, and so does the registry. bino needs an OIDC token for it: on GitHub Actions it requests one itself, and elsewhere it reads SIGSTORE_ID_TOKEN. There is no browser login.
  • --key takes an unencrypted PKCS #8 PEM private key, ed25519 or ECDSA P-256. Generate one with openssl genpkey -algorithm ed25519 -out acme-signing.pem and give consumers the public key (openssl pkey -in acme-signing.pem -pubout -out acme-signing.pub). Keep the private key out of the package folders.
  • --cert-chain adds the certificate for that key, issued by your company CA: the leaf first, then the intermediates.

A scope can require signed releases. An unsigned publish to it fails with signature_required.

name: publish
on:
  push:
    tags: ["v*"]

permissions:
  contents: read
  id-token: write # lets bino request the OIDC token for Sigstore

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install bino
        run: /bin/bash -c "$(curl -fsSL https://github.com/bino-bi/bino-cli-releases/releases/latest/download/install.sh)"
      - name: Publish
        env:
          BINO_REGISTRY_TOKEN: ${{ secrets.BINO_REGISTRY_TOKEN }}
        run: bino publish --bump patch --sign --keyless

The signature records the run: repository, workflow, ref, commit and run URL, as the Sigstore certificate states them. This example publishes with a token, so the signature names the publish channel pat; drop the env block to use Trusted Publishing instead. Consumers pin the repository and the workflow:

[[trust.signer]]
scope = "@acme/*"
oidc-issuer = "https://token.actions.githubusercontent.com"
repository = "https://github.com/acme/reports"
workflow = "https://github.com/acme/reports/.github/workflows/publish.yml"

Nothing about consumption is special - see Registry and dependencies:

bino registry add @acme/finance-kit
spec:
  children:
    - kind: Table
      ref: "@acme/finance-kit/waterfall"
      params:
        REGION: EU