···
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).
49
+
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
50
+
make a `hello` package available in opam.ocaml.org.
51
+
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.
53
+
The top-level sources contain the following files with the opam file having the same
54
+
name of the project.
65
+
A quick summary of the steps to be followed are listed below:
71
+
$ dune-release distrib
72
+
$ dune-release publish
73
+
$ dune-release opam pkg
74
+
$ dune-release opam submit
77
+
We will now go through each of the above commands in detail:
81
+
The OCaml source package needs to be built with `dune`, `dune-project`
82
+
and `.opam` files along with the sources. The build should be
83
+
successful before proceeding further. For example:
87
+
Done: 56/61 (jobs: 1)
90
+
* `dune-release lint`
92
+
The `lint` command checks for the presence of meta files in the
93
+
project folder, and also runs `opam lint`. A sample output is given
94
+
below for your reference:
98
+
[ OK ] File README is present.
99
+
[ OK ] File LICENSE is present.
100
+
[ OK ] File CHANGES is present.
101
+
[ OK ] File opam is present.
102
+
[ OK ] lint opam file hello.opam.
103
+
[ OK ] opam field description is present
104
+
[ OK ] opam fields homepage and dev-repo can be parsed by dune-release
105
+
[ OK ] Skipping doc field linting, no doc field found
106
+
[ OK ] lint /home/guest/hello success
109
+
You need to fix any errors reported by linting, and commit the changes
112
+
* `dune-release tag`
114
+
A ChangeLog `CHANGES` file is required, and the format used is
116
+
[dune-release](https://github.com/ocamllabs/dune-release)
117
+
documentation. A minimal example is as follows:
122
+
## v0.0.1 (2021-02-23)
124
+
- Meta files for dune release
127
+
After updating the CHANGES file, you need to tag the release. You will
128
+
be prompted to confirm the version, as can be seen in the following
133
+
[-] Extracting tag from first entry in CHANGES
134
+
[-] Using tag "v0.0.1"
135
+
[?] Create git tag v0.0.1 for HEAD? [Y/n]
137
+
[+] Tagged HEAD with version v0.0.1
140
+
* `dune-release distrib`
142
+
The sources are then archived to create a distribution as illustrated
146
+
$ dune-release distrib
147
+
[-] Building source archive
148
+
[+] Wrote archive _build/hello-v0.0.1.tbz
150
+
[-] Linting distrib in _build/hello-v0.0.1
151
+
[ OK ] File README is present.
152
+
[ OK ] File LICENSE is present.
153
+
[ OK ] File CHANGES is present.
154
+
[ OK ] File opam is present.
155
+
[ OK ] lint opam file hello.opam.
156
+
[ OK ] opam field description is present
157
+
[ OK ] opam fields homepage and dev-repo can be parsed by dune-release
158
+
[ OK ] Skipping doc field linting, no doc field found
159
+
[ OK ] lint _build/hello-v0.0.1 success
161
+
[-] Building package in _build/hello-v0.0.1
162
+
Done: 56/60 (jobs: 1)[ OK ] package builds
164
+
[-] Running package tests in _build/hello-v0.0.1
165
+
Done: 0/0 (jobs: 0)[ OK ] package tests
167
+
[+] Distribution for hello 0.0.1
168
+
[+] Commit c9935ac42271ce23cc422c299c5c3aaf92646499
169
+
[+] Archive _build/hello-v0.0.1.tbz
172
+
* `dune-release publish`
174
+
You can now publish the distribution to your GitHub repository as
178
+
$ dune-release publish
179
+
[-] Skipping documentation publication for package hello: no doc field in hello.opam
180
+
[-] Publishing distribution
181
+
[-] Publishing to github
182
+
[?] Push tag v0.0.1 to git@github.com:guest/hello? [Y/n]
184
+
[-] Pushing tag v0.0.1 to git@github.com:guest/hello
185
+
[?] Create release v0.0.1 on git@github.com:guest/hello? [Y/n]
187
+
[-] Creating release v0.0.1 on git@github.com:guest/hello via github's API
188
+
[+] Succesfully created release with id 38465706
189
+
[?] Upload _build/hello-v0.0.1.tbz as release asset? [Y/n]
191
+
[-] Uploading _build/hello-v0.0.1.tbz as a release asset for v0.0.1 via github's API
194
+
* `dune-release opam pkg`
196
+
The .opam file can then be generated using the following command:
199
+
$ dune-release opam pkg
200
+
[-] Creating opam package description for hello
201
+
[+] Wrote opam package description _build/hello.0.0.1/opam
204
+
* `dune-release opam submit`
206
+
The `~/.config/dune/release.yml` file should then be updated with your
207
+
opam repository settings as indicated below (in particular, change `<username>` by your local username and `<github-user>` by your own github username):
210
+
$ cat ~/.config/dune/release.yml
213
+
remote: git@github.com:<github-username>/opam-repository.git
214
+
local: /home/<username>/.cache/dune/opam-repository/
218
+
You can now submit your package to be included to opam.ocaml.org using
219
+
the following command, which will create a new pull request to
220
+
ocaml/opam-repository:
223
+
$ dune-release opam submit
225
+
[-] Preparing pull request to ocaml/opam-repository
226
+
[-] Fetching https://github.com/ocaml/opam-repository.git#master
227
+
[-] Checking out a local release-hello-0.0.1 branch
228
+
[-] Pushing release-hello-0.0.1 to git@github.com:guest/opam-repository
229
+
[?] Open PR to ocaml/opam-repository? [Y/n]
231
+
[-] Opening pull request to merge branch release-hello-0.0.1 of git@github.com:guest/opam-repository into ocaml/opam-repository
234
+
Congratulations on submitting your first OCaml package!
Adopting and relinquishing package maintainership
-------------------------------------------------