ocaml-ci icon indicating copy to clipboard operation
ocaml-ci copied to clipboard

Support for adding custom opam repositories in the CI (opam repo add)

Open mbarbin opened this issue 6 months ago • 1 comments

Opam lets you specify additional opam repositories where packages may be advertised in addition to the default public opam-repository (see e.g. opam repo add --help).

I make use of this sometimes for some projects. For example I've documented a workflow that uses this here.

In the GitHub action, if you use Setup OCaml you can add extra custom repositories by using the opam-repositories variable, for example such as here.

Given that there is no equivalent to CI .yml action files when using ocaml-ci, I am not sure where this bit of configuration could be specified, if at all.

Is this supported at the moment? If not, I wanted to express interest for this. Thank you!

mbarbin avatar Jun 10 '25 10:06 mbarbin

Something new occurred to me that could be useful for this ticket, commenting below.

The new dune pkg management has support for dune-workspace files where you can configure such additional opam repository. See an example below:

(lang dune 3.20)

(lock_dir
 (repositories overlay upstream mbarbin))

(repository
 (name mbarbin)
 (url "git+https://github.com/mbarbin/opam-repository.git"))

Given that there is no equivalent to CI .yml action files when using ocaml-ci, I am not sure where this bit of configuration could be specified, if at all.

Even in cases where ocaml-ci doesn't make use of the dune-pkg build, perhaps this file, and the repository stanza in particular could be used to detect the extra repo. It seemed to me this could be a useful heuristic to add to the current ocaml-ci, which would work without designing a new config file. but I am not sure how many repos that would really help. Just a thought. Thank you!

mbarbin avatar Sep 22 '25 07:09 mbarbin