···
should not be filed here but on the opam tool
[issue tracker](https://github.com/ocaml/opam/issues).
Reporting package installation issues
-------------------------------------
···
issue tracker to see if it doesn't concern an existing issue. If that
is the case mention it in your pull request.
···
[opam's manual](https://opam.ocaml.org/doc/Packaging.html).
+
If you are using `dune` and hosting your git repository on `github` you can use the following tutorial that provides a step-by-step procedure to
+
make a `hello` package available in opam.ocaml.org.
+
If you are not using `dune` or hosting your project on `github` you can still use `opam-publish` as described by the manual page linked above.
+
The top-level sources contain the following files with the opam file having the same
+
A quick summary of the steps to be followed are listed below:
+
$ dune-release opam pkg
+
$ dune-release opam submit
+
We will now go through each of the above commands in detail:
+
The OCaml source package needs to be built with `dune`, `dune-project`
+
and `.opam` files along with the sources. The build should be
+
successful before proceeding further. For example:
+
The `lint` command checks for the presence of meta files in the
+
project folder, and also runs `opam lint`. A sample output is given
+
below for your reference:
+
[ OK ] File README is present.
+
[ OK ] File LICENSE is present.
+
[ OK ] File CHANGES is present.
+
[ OK ] File opam is present.
+
[ OK ] lint opam file hello.opam.
+
[ OK ] opam field description is present
+
[ OK ] opam fields homepage and dev-repo can be parsed by dune-release
+
[ OK ] Skipping doc field linting, no doc field found
+
[ OK ] lint /home/guest/hello success
+
You need to fix any errors reported by linting, and commit the changes
+
A ChangeLog `CHANGES` file is required, and the format used is
+
[dune-release](https://github.com/ocamllabs/dune-release)
+
documentation. A minimal example is as follows:
+
- Meta files for dune release
+
After updating the CHANGES file, you need to tag the release. You will
+
be prompted to confirm the version, as can be seen in the following
+
[-] Extracting tag from first entry in CHANGES
+
[?] Create git tag v0.0.1 for HEAD? [Y/n]
+
[+] Tagged HEAD with version v0.0.1
+
* `dune-release distrib`
+
The sources are then archived to create a distribution as illustrated
+
[-] Building source archive
+
[+] Wrote archive _build/hello-v0.0.1.tbz
+
[-] Linting distrib in _build/hello-v0.0.1
+
[ OK ] File README is present.
+
[ OK ] File LICENSE is present.
+
[ OK ] File CHANGES is present.
+
[ OK ] File opam is present.
+
[ OK ] lint opam file hello.opam.
+
[ OK ] opam field description is present
+
[ OK ] opam fields homepage and dev-repo can be parsed by dune-release
+
[ OK ] Skipping doc field linting, no doc field found
+
[ OK ] lint _build/hello-v0.0.1 success
+
[-] Building package in _build/hello-v0.0.1
+
Done: 56/60 (jobs: 1)[ OK ] package builds
+
[-] Running package tests in _build/hello-v0.0.1
+
Done: 0/0 (jobs: 0)[ OK ] package tests
+
[+] Distribution for hello 0.0.1
+
[+] Commit c9935ac42271ce23cc422c299c5c3aaf92646499
+
[+] Archive _build/hello-v0.0.1.tbz
+
* `dune-release publish`
+
You can now publish the distribution to your GitHub repository as
+
[-] Skipping documentation publication for package hello: no doc field in hello.opam
+
[-] Publishing distribution
+
[-] Publishing to github
+
[?] Push tag v0.0.1 to git@github.com:guest/hello? [Y/n]
+
[-] Pushing tag v0.0.1 to git@github.com:guest/hello
+
[?] Create release v0.0.1 on git@github.com:guest/hello? [Y/n]
+
[-] Creating release v0.0.1 on git@github.com:guest/hello via github's API
+
[+] Succesfully created release with id 38465706
+
[?] Upload _build/hello-v0.0.1.tbz as release asset? [Y/n]
+
[-] Uploading _build/hello-v0.0.1.tbz as a release asset for v0.0.1 via github's API
+
* `dune-release opam pkg`
+
The .opam file can then be generated using the following command:
+
$ dune-release opam pkg
+
[-] Creating opam package description for hello
+
[+] Wrote opam package description _build/hello.0.0.1/opam
+
* `dune-release opam submit`
+
The `~/.config/dune/release.yml` file should then be updated with your
+
opam repository settings as indicated below (in particular, change `<username>` by your local username and `<github-user>` by your own github username):
+
$ cat ~/.config/dune/release.yml
+
remote: git@github.com:<github-username>/opam-repository.git
+
local: /home/<username>/.cache/dune/opam-repository/
+
You can now submit your package to be included to opam.ocaml.org using
+
the following command, which will create a new pull request to
+
$ dune-release opam submit
+
[-] Preparing pull request to ocaml/opam-repository
+
[-] Fetching https://github.com/ocaml/opam-repository.git#master
+
[-] Checking out a local release-hello-0.0.1 branch
+
[-] Pushing release-hello-0.0.1 to git@github.com:guest/opam-repository
+
[?] Open PR to ocaml/opam-repository? [Y/n]
+
[-] Opening pull request to merge branch release-hello-0.0.1 of git@github.com:guest/opam-repository into ocaml/opam-repository
+
Congratulations on submitting your first OCaml package!
Adopting and relinquishing package maintainership
-------------------------------------------------