# Publishing Releases

A **release** is a tag of a public repository, published for anyone to browse and download: a fixed, cached snapshot of exactly what that tag points at. Releases are how you distribute a dataset, a set of sample files, model weights, an asset pack, or a game build from Swarmfile, without anyone needing to join your organization. Distributing an open-source repository end to end? Start with the [Publishing Quickstart](https://swarmfile.com/docs/guides/publishing-quickstart) and come back here for every knob.

This page is the publisher's walkthrough. [Public Repositories & Org Profiles](https://swarmfile.com/docs/guides/public-repositories-and-org-profiles) covers what visitors see and how your organization's public page works.

## Before you start

- **The repository must be public.** Visibility is chosen when a repository is created and never changes, and public repositories use the unencrypted storage tier (anything the world can download has nothing left to encrypt at rest). On the Free plan repositories may be public or private, but only a public one can be published; on a paid plan, choose **Public** when you create the repository. A private repository can't be published - copy the content into a new public repository instead.
- **You need the right access.** On a protected-mode repository, publishing needs repository-wide admin access (org owners and the repository's creator always have it). On an open-mode repository, any member who can write the whole repository can publish. You can't publish a tag that contains anything you're denied read on, and you need a verified email. [Permissions](https://swarmfile.com/docs/admin/permissions) has the details, including how a publish fails safe when permissions can't be checked.

## 1. Tag the commit

A release always publishes a **tag**, and a tag always names one commit. Commit the state you want to ship, then tag it:

```bash
swarmfile commit -m "Dataset v1.0"
swarmfile tag create v1.0
```

Tags are immutable pointers for the native `swarmfile tag` command: there's no "move this tag." To point a name somewhere else, delete the tag and create it again, or, if the repository has git access, move a lightweight tag through the git remote (`git push -f origin <tag>`; `git push origin :refs/tags/<tag>` deletes it).

Once a tag is published as a release, treat it as permanent: people may already have downloaded it, and the release keeps serving until you unpublish it. Tagging also protects that commit from history clean-up for as long as the tag exists.

The tag names `issues`, `discussions` and `releases` are reserved for the public repository page's tabs, and `releases.xml` is its Atom feed URL, so publishing under one of those exact names is refused; use a different tag name.

## 2. Publish it

Publish from the dashboard's **Releases** tab (repository → **Releases** → **Publish release…**). The wizard walks through choosing the tag, checking exactly what will become public, and confirming - the preflight shows the files and total size, anything `.swarmfile/publicignore.yml` keeps out, and any tracked paths `.gitignore`/`.swarmfileignore` hide from the web file browser that will still publish. If you fixed `.swarmfile/publicignore.yml` after cutting the tag, the preflight says the tag's policy differs from the branch's current one - publish a new tag to apply the fix.

You can also publish from the Desktop App's **Releases** page, or from the CLI - `swarmfile release preflight v1.0` shows exactly what would publish (files, hidden paths, ignore-file mismatches, a policy that differs from the branch) without publishing anything, and exits non-zero when the tag can't be published:

```bash
swarmfile release preflight v1.0
swarmfile release create v1.0
swarmfile release list        # shows pending → ready (or failed)
```

A new release starts **pending** while Swarmfile builds its download archive, then becomes **ready** (or **failed**, with a reason). Re-running `release create` on a tag that's already published does nothing, unless the earlier attempt failed in a way that can be retried. If a publish failed permanently, tag a new commit and publish that.

To take a release down, use **Unpublish** on the Releases tab, or `swarmfile release delete <id>` (the id comes from `release list`). Unpublishing is a real delete, needs the same access as publishing, and removes the release from your public pages and Explore within a minute or two of edge caching.

## What a release includes

- **The whole tagged tree**, browsable file by file on the repository's public page at `/public/<org-slug>/<repository-slug>`. Anyone can browse, preview, and stream byte ranges of a release's files without an account - a visitor can scrub a large video or dataset before downloading anything. (On a [bring-your-own-storage](https://swarmfile.com/docs/admin/bring-your-own-storage) org, anonymous streaming from your bucket is off until an owner enables **Allow anonymous streaming from my bucket**.)
- **Downloads without an account.** Downloading individual files, or the release's source tree as a single `.tar` **archive**, needs no account. Every file or archive download request carries a quick, one-time proof-of-work check in the browser (a few milliseconds of CPU that makes bulk scraping expensive), plus per-network fairness limits - a visitor never has to sign in. Attached release assets are separate anonymous downloads; the public page's primary download picks the platform build (or self-hosted bundle). From the CLI: `swarmfile release fetch --org <org> --repository <repository> --tag v1.0 --out release.tar`, or add `--path` for one file. Files marked executable (`swarmfile chmod +x`) extract executable from the archive (mode `0755`); every other file extracts as `0644`. Serving those downloads is free: egress is unlimited and unmetered on every plan, so a widely used release costs storage, not bandwidth. (Anonymous reads carry an abuse backstop - a platform-wide hourly ceiling that can refuse further anonymous reads under extreme volume; see [Telemetry & Data Collection](https://swarmfile.com/docs/reference/telemetry-and-data-collection).)
- **The README** the release ships, rendered as the landing view of the repository page.
- **Generated release notes** summarizing what changed since the previous release.
- **Download counts** per release (they lag by up to about an hour), and the contributors of the release.
- **Attached assets.** A release can carry named binaries that are deliberately outside the repository tree - build artifacts, installers, model checkpoints - served at `/public/<org-slug>/<repository-slug>/assets/<name>` and listed in the release page's Assets section. From the CLI:

  ```bash
  swarmfile release attach v1.0 dist/widgets-1.0-macos-arm64.tar.gz
  swarmfile release assets v1.0
  swarmfile release detach v1.0 widgets-1.0-macos-arm64.tar.gz
  ```

  The dashboard's Releases tab manages the same set from **Assets** on a release: attach a file up to 100 MiB, or remove one. Larger files attach with the CLI only, which uploads them directly to the repository's storage (up to 5 GiB). Re-attaching the same name replaces the asset. It also shows each asset's download count and bytes served, plus a per-path, 30-day **Download activity** panel for the whole release (members only).

## Streaming allowance

Anonymous byte-range reads of a public repository - browsing a file's bytes,
scrubbing a release video, or reading release media - draw on the organization's
**public streaming pool**. The pool refills continuously; the plan sets its soft
and hard limits, and a hard cap refuses further anonymous ranges with a short
`Retry-After` while the soft crossing only warns.

The dashboard's **Public streaming** card shows the live pool to any member (owners also see it under
**Settings → Usage**), including the warning line and any operator override.
This allowance is separate from egress: member and P2P transfer stays unlimited
and unbilled, and a platform-wide anonymous-read backstop is an additional
ceiling ([Telemetry & Data Collection](https://swarmfile.com/docs/reference/telemetry-and-data-collection)).

## Keeping paths out of a release

Some of a repository's files shouldn't go to the public page even when the rest should - internal notes, key material, licensed assets, an unpublished cut. Commit a `.swarmfile/publicignore.yml` at the repository root and list the paths to hide (and, optionally, set how platform-generated derived data is exposed):

```yaml
version: 1
paths:
  - "internal/*"
  - "**/*.secret"
  - "!internal/public/"     # re-include a folder a pattern above hid
```

`paths` uses the same gitignore-style globs as `.swarmfileignore`: `*`, `**`, a trailing `/` for a folder, and a leading `!` to re-include - last matching line wins. As in git, a folder must be re-included before anything inside it can be.

`derived` sets the visibility of data the platform generates around a release rather than files you committed. Its `ci_logs` key sets the exposure of CI-run logs attached to a release (`member-only` by default; `public` exposes them to anonymous visitors):

```yaml
derived:
  ci_logs: member-only   # or public
```

`member-only` (the default when the file or the key is absent) keeps those CI logs visible to members only; `public` exposes them on the public page alongside the release.

The file is read from the version committed on the tag being published, and applied as the release is built:

- Hidden paths are left out of the public release entirely - no browse entry, no raw stream or download, nothing in the archive, file search or Explore. They aren't merely blocked; they never enter it.
- The policy file itself is never published, since its globs name exactly the paths it hides.
- If the file is invalid, the publish **fails with the reason** instead of publishing everything. Fix it and publish a new release. (A release that fails because storage couldn't be read can simply be retried.)
- Changing the file affects **future publishes only**. A release that's already published keeps the contents it was built with - publish a new tag to apply a change.

The policy hides nothing from members; ACLs still apply. The policy governs the public release and browser surfaces, and it also sets the **anonymous git history boundary**: while any active branch's committed tree carries a `.swarmfile/publicignore.yml` that hides a path in it, any tag's committed tree does, or a ready (published) release hid paths, anonymous cloning is refused outright while that committed head, tag or ready release hides them, though a release already published keeps the contents it was built with.

The boundary evaluates both committed trees a branch can advertise (its confirmed head changeset's tree and its live head tree - they differ for a fork taken from a dirty source) and every tag's changeset tree. A path that exists only in an older commit is not retroactively hidden.

The publish wizard's preflight audits a bounded slice of the tag's history (up to 100 commits, under its own 800-tree-object and 200,000-file caps - separate from the anonymous-clone boundary's 100-tree/500-object/200,000-file caps) and warns when paths hidden by the policy also exist in older commits, listing a small sample of their names for owners and admins; that check is advisory and never blocks publishing.

Treat the warning as a remediation prompt: rotate any exposed secret and rewrite the history (or move the repository) rather than relying on the policy, because a policy is not a retroactive history scrub. The audit reports `truncated` when it stops at a cap, so its count is then a lower bound.

There is no filtered clone, because git history is content-addressed: hiding paths at the same commit ids would change every tree's OID and contradict the public history the project page shows. An anonymous clone also carries commit messages and the committed `.swarmfile/publicignore.yml` verbatim (filtering either would change commit ids); the web commit list and the federation activity/commit feeds redact path names the policy hides, but a clone does not - never put a secret in a public commit message.

An invalid or unreadable policy, or a boundary read/walk error, refuses anonymous clone (fail closed). A change takes effect within about a minute as the boundary verdict expires; the git refs themselves are answered `Cache-Control: no-store` and served live, not from an edge or browser cache. A policy that hides nothing does not block.

Publishing still requires anonymous cloning off while a release would hide paths: the web wizard says so, disables **Continue**, and offers a one-click **Turn off anonymous clone**; scripts get a `409` with code `publicignore_clone_exposure` and the same remediation. Once the release is ready, turning anonymous cloning back on does not re-expose the paths while the ready release or an active branch's committed tree still hides them. Hiding a path is not a retroactive takedown either: it keeps the path out of new releases, but copies already downloaded stay where they are.

## Provenance: commit pinning

A release names the commit hash its tag points at, and the repository page shows it with a **commit-pinned** badge. Because commit hashes chain every file's content and all the history before it, the hash pins exactly what was published.

The release also carries a manifest digest signed with the hub's Ed25519 history key, and the public page recomputes that digest in your browser and checks the signature, without downloading anything. When the signature checks out against Swarmfile's signing key, which is built into the site itself rather than taken from the release, the page shows a green **Verified by Swarmfile** badge. A valid signature by any other key reads *Signed by an unrecognized key*, and a digest or signature that doesn't match is called out explicitly.

The commit-pinned badge itself is the pointer, not a proof: anyone can check the repository's signed commit chain with [`swarmfile-verify-history`](https://swarmfile.com/docs/cli/swarmfile-verify-history), as [Verifiable History](https://swarmfile.com/docs/guides/verifiable-history) explains, and `swarmfile materialize hash:<commit-hash>` reproduces the exact tree on any machine with access to the repository.

Owners can edit the generated release notes from the release page (a per-release summary of up to 4,000 characters), and the edit survives re-publishes.

## Being found: Explore, following, and feeds

- **Explore.** Every public repository with at least one release is listed on [Explore](https://swarmfile.com/explore), Swarmfile's public directory, with search over names, descriptions, topics, README text and file paths. There's no separate opt-in: public plus a release means listed. Until the first release, a public repository's card shows on your org profile, but there's nothing to browse yet. Archiving a repository removes it from the listings until you unarchive it.
- **Follow releases.** A visitor with a verified free account can follow a repository (or your whole organization) and gets one email per new release, with a one-click unsubscribe.
- **Atom feed.** Your organization's releases across all its public repositories are published as a feed at `/feeds/<org-slug>/releases.xml`, no account needed.

## Getting a copy: fork into your own org

On a release's public page, **Copy** (in the repository actions) copies that release into a new repository in an organization where the visitor can create repositories, then offers to open it in the Desktop App. It's a one-time snapshot: the copy doesn't track the original, and later releases don't flow into it.

Small releases copy straight away; a large one runs as a background job with progress and a cancel button. The destination organization's plan limits and storage quota apply, and copies are rate-limited per person.

The copy the web flow creates is a **public** repository (it holds a public release); pasting that release into one of your **private** repositories runs on your own machine instead, through the Desktop App's CLI - `swarmfile clone <org>/<repository> --into <your-org>/<repository>` (add `--tag <tag>` to pick a release) - which encrypts the files there before they leave your computer.

A copy records where it came from: the new repository's public page links back with **Forked from**, and the original's page lists its public forks. The web action's copy is a *verified* fork (the platform performed it); a copy created by the CLI's `--new --public` records the same canonical source but is labeled **claimed**, because the copy itself isn't verified.

This is also the way to get a public copy of work: publish into a public repository, or copy a release into a new repository of your own.

## Current limitations

- Forks are one-time snapshots: later upstream releases don't flow into a fork (its owners and admins get an **Upstream released** notification instead), and a fork's public page links back with "Forked from". A fork can propose a branch back to the upstream as a merge request when the upstream's **Cross-repository contributions** setting allows it ([Publishing Quickstart, step 7](https://swarmfile.com/docs/guides/publishing-quickstart#7-keep-the-door-open-for-contributors)). Stars and release-follow live on each repository's public page ([Public Repositories & Org Profiles](https://swarmfile.com/docs/guides/public-repositories-and-org-profiles)).
- Public commit history is git-enabled-only: on a repository with git access turned on, the release page lists the commits leading to the release's pinned commit; on a repository without it, visitors see releases, not the commit log - that data was never public.
- Anonymous cloning is **on by default** for a public, git-enabled repository: the page's **Install & clone** shelf shows the repository's `git clone` command and a signed-out visitor can use it - read-only, no push. An owner turns it off from **Repository settings → Public page** (web and desktop), or `swarmfile git anonymous-clone off`; while it's off the page doesn't advertise the command. Members of a git-enabled repository can always [`git clone` it](https://swarmfile.com/docs/guides/git-clone).
