Publish
Publish an OCaml package to open-opam from its GitHub release.
How do I publish?
First install GitHub CLI and sign in with gh auth login: open-opam acts as you through it.
opam repo add open-opam https://github.com/open-opam/opam-repository.git
opam install open-opamopen-opam init
open-opam check 1.2.3
open-opam release 1.2.3
open-opam publish 1.2.3open-opam's init prepares your repository once.check tells you before tagging whether a version would pass. release tags the commit and makes its immutable release. publish sends the release to the registry, which merges it once its checks pass. status shows where it stands.
To let official opam's file win where both repositories hold the same package version, add the registry last, with --rank=-1.
What does my release need?
An immutable GitHub release, with its source archive attached before it is published. The registry checks it against these rules:
- Allowed files
- Release proof
- Archive equals tag
- Exact match
- Name ownership
- Metadata and standard
- Author's CI
- Install
What does my project need?
CI that runs on the branch you tag, and a README, an .mli and a test.
Who owns a package name?
The repository that first publishes it. A name official opam already holds can only be published from the repository official opam names for it.
Can I take a release back?
open-opam revoke 1.2.3. opam stops installing it, and it stays listed.
What doesn't it do?
GitHub and dune only. No person reviews a package, so passing the checks doesn't mean the code is safe.
Command reference
open-opam init
Prepares your repository to publish, once.
open-opam initopen-opam check
Says whether this commit, released as VERSION, would pass, before you tag it.
open-opam check [VERSION]open-opam release
Checks this commit, then tags it as VERSION and makes its immutable release, with the archive the checks read.
open-opam release VERSIONopen-opam publish
Sends the release tagged VERSION to the registry.
open-opam publish VERSIONopen-opam revoke
Takes a release back: opam stops installing it, and it stays listed.
open-opam revoke VERSIONopen-opam status
Shows what the registry holds of your packages, and what is waiting to be published or revoked.
open-opam status