ocaml-opam / opam-publish

A tool to ease contributions to opam repositories
https://opam.ocaml.org
Other
40 stars 21 forks source link

Handle repositories using submodules in github #145

Open aryx opened 1 year ago

aryx commented 1 year ago

Right now opam publish uses the latest git tag in a repo and rely on github to produce the .tar.gz archive for the source of the repository. Unfortunately, github does not add the code of submodules in the archive (a known problem: https://github.com/dear-github/dear-github/issues/214 ), and so in most cases you can't build a project from the archive. How opam publish could be extended to make it easy to package projects using submodules?

See for example: https://github.com/ocaml/opam-repository/pull/23215 for a recent example.

kit-ty-kate commented 1 year ago

This is a difficult problem. Currently opam-publish doesn’t deal with archive creation at all and mairly picks up autogenerated ones for conveinance sake.

Adding this feature to opam-publish is really involved. We’d need to:

If we only make sure the github release is present this could simplify things a lot and avoid some of the pitfalls of dune-release, but this would mean this would be a more manual approach to releasing, as currently users use opam-publish this way:

with this option it would be something like:

Incidentally this is closer to what I have for my own projects: https://github.com/kit-ty-kate/ocaml-release-script