@@ -13,16 +13,69 @@ Add this repo to the current opam switch:
1313$ opam repository add binary-packages git+https://github.com/ocaml-dune/ocaml-binary-packages
1414```
1515
16- ## Maintenance notes
16+ ## Adding a new version of a package
1717
18- Binary packages are automatically built and released on github when a tag of
19- this repo is pushed. The convention for naming tags is ` <date>.<count> ` , for
20- example ` 2024-10-17.3 ` would be the 4th release on 2024-10-17 (the count starts
21- at 0).
18+ We'll use the release of ` ocaml-lsp-server.1.20.0 ` as an example here. This is
19+ a list of steps for making the binary versions of this package available.
2220
23- The version of the compiler used to build a package is included in its version
24- number. This is mostly so that packages that need binary versions to be
25- available from specific compiler versions (e.g. ocaml-lsp-server) can co-exist
26- in the repo, however it's also included for debugging purposes.
21+ 1 . Add entries to the ` strategy.matrix.include ` list for the
22+ ` ocaml-lsp-server-build-script ` _ and_ ` ocaml-lsp-server-dockerfile ` jobs in
23+ the file ` .github/workflows/build.yml ` . Each package has two different jobs -
24+ one that builds the packages natively for MacOS, and another that builds the
25+ packages in a docker container for Linux (this makes it easier to distribute
26+ statically-linked binaries on Linux). Each entry in the ` include ` lists
27+ specifies a package version (` version ` ) and an OCaml version (` ocaml ` ). For
28+ ocamllsp specifically it's useful to build each version of the package with
29+ as many different versions of the compiler as possible since the ocamllsp
30+ executable can only analyze code that was compiled with the same version of
31+ the compiler as itself. Find out which versions of the compiler are
32+ supported by running ` opam show ocamllsp.1.20.0 ` .
2733
28- The tag of the release is also included in the version number for traceability.
34+ In this case, the new entries were:
35+ ```
36+ jobs:
37+ ocaml-lsp-server-build-script:
38+ ...
39+ - os: macos-14
40+ version: "1.20.0"
41+ ocaml: "5.2.1"
42+ target_triple: aarch64-apple-darwin
43+ - os: macos-13
44+ version: "1.20.0"
45+ ocaml: "5.2.1"
46+ target_triple: x86_64-apple-darwin
47+ - os: macos-14
48+ version: "1.20.0"
49+ ocaml: "5.2.0"
50+ target_triple: aarch64-apple-darwin
51+ - os: macos-13
52+ version: "1.20.0"
53+ ocaml: "5.2.0"
54+ target_triple: x86_64-apple-darwin
55+
56+ ocaml-lsp-server-dockerfile:
57+ ...
58+ - os: ubuntu-latest
59+ version: "1.20.0"
60+ ocaml: "5.2.1"
61+ target_triple: x86_64-unknown-linux-musl
62+ - os: ubuntu-latest
63+ version: "1.20.0"
64+ ocaml: "5.2.0"
65+ target_triple: x86_64-unknown-linux-musl
66+ ```
67+
68+ 2 . Trigger a build of all binary packages by pushing a new tag to [ this repo] ( https://github.com/ocaml-dune/ocaml-binary-packages ) .
69+ Name the tag ` <date>.<count> ` where ` date ` is today's date in ` YYYY-MM-DD ` ,
70+ and ` count ` is how many times a tag has been pushed to the repo on the
71+ current day (ie. the number of the release starting from 0). So the second
72+ release on ` 2024-12-12 ` would have a tag named ` 2024-12-12.1 ` . Push to your
73+ own fork of the repo if you want to do experiments with the build scripts.
74+
75+ 3 . Create the opam files for the new packages. Opam files are generated with
76+ python scripts inside the ` packages/<package> ` directory for each package.
77+ The scripts have a ` versions ` list which contains all the different opam
78+ versions of the package. There are potentially many versions of each package
79+ because a there's a different versions for each OS, arch, and package
80+ version, and in ocamllsp's case for each compiler version. Add the new
81+ versions of the package to the ` versions ` list (programatically of course).
0 commit comments