|
|
... |
|
|
|
A library (or set of dune libraries) can be published to an opam repository. For this, an opam package file needs to be created with these fields. |
|
|
|
The corresponding dune file must have a `public_name` field sharing the same name. This `public_name` field will be used by other dune files to list their dependency on your library, while the `name` will be used by OCaml code that wants to interact with the module. (In theory the `name` field can be anything but you should avoid that.) |
|
|
|
An opam package can be a set of dune libraries. This sub-library will have to be imported as `my_lib.thing` by other dune files, but will be used as `my_lib_thing` by OCaml code. |
|
|
|
Before publishing an opam package you need a license in your repository. |
|
|
|
And a README, we're not fools. |
|
|
|
You will also need to keep track of a changelog for each new version of your library. |
|
|
|
To publish a package you can install `dune-release`. |
|
Make sure your package is correctly set up |
|
This will automatically detect the new version (in `CHANGES.md` and your opam package file `my_lib.opam`) and tag the repository accordingly. |
|
Finally, you can use this command to push the tag to your remote repository and create a pull request to the opam repository. |
|