|
| 1 | += How to release a new OCamlbuild version = |
| 2 | + |
| 3 | +The steps below describe what needs to be done to release a new |
| 4 | +OCamlbuild version. The process should be simple and fast, so that we |
| 5 | +can release often. |
| 6 | + |
| 7 | +== Preparing the release == |
| 8 | + |
| 9 | +The steps can be done a few days in advance, and coordinated among |
| 10 | +several people. External contributors can do it, and you can use pull |
| 11 | +requests to get reviews and feedback. |
| 12 | + |
| 13 | +[[synch-opam-files]] |
| 14 | +=== Synchronizing the local and remote opam files === |
| 15 | + |
| 16 | +One of the last release steps is to <<opam-repo,update the public opam |
| 17 | +repository>>, and this will require an 'opam' file describing the |
| 18 | +installation-related metadata. There are two sources of inspiration |
| 19 | +for these opam files: |
| 20 | + |
| 21 | +- there is a local 'opam' file at the root of the ocamlbuild |
| 22 | + repository, that is used for pinning the development version. |
| 23 | + |
| 24 | +- there are the 'opam' files for previous OCamlbuild releases in the |
| 25 | + public opam repository: |
| 26 | + https://github.com/ocaml/opam-repository/tree/master/packages/ocamlbuild/ |
| 27 | + |
| 28 | +In theory the two should be in synch: the 'opam' file we send to the |
| 29 | +public opam repository is derived from the local 'opam' file. However, |
| 30 | +upstream opam repository curators may have made changes to the public |
| 31 | +opam files, to reflect new packaging best practices and policies. You |
| 32 | +should check for any change to the latest version's 'opam' file; if |
| 33 | +there is any, it should probably be reproduced into our local 'opam' |
| 34 | +file. |
| 35 | + |
| 36 | +Note that the local file may have changed during the release lifetime |
| 37 | +to reflect new dependencies or changes in packaging policies. These |
| 38 | +changes should be preserved. |
| 39 | + |
| 40 | +You can use +opam lint+ in the package repository to check that the |
| 41 | +current opam file satisfies best practices. |
| 42 | + |
| 43 | +=== Changes and annoucement === |
| 44 | + |
| 45 | +The 'Changes' file at the root of our repository serves as a user- and |
| 46 | +contributors-facing memory of the project evolution. The section |
| 47 | +concerning the current development version is marked NEXT_RELEASE; |
| 48 | +before the release. |
| 49 | + |
| 50 | +==== Changes entries ==== |
| 51 | + |
| 52 | +Check the detailed changelog to make sure that no important feature is |
| 53 | +missing, and that compatibility-breaking changes are probably marked, |
| 54 | +and that existing change entries are descriptive enough. |
| 55 | + |
| 56 | +Changes entries should: |
| 57 | + |
| 58 | +- Describe the change in a way that end-users can understand |
| 59 | + |
| 60 | +- Explicitly say whether it breaks compatibility, and in particular use |
| 61 | + "* " as an entry bullet point in this case. |
| 62 | + |
| 63 | +- Link to the relevant online discussions of the change by giving PR |
| 64 | + or issue numbers when relevant. |
| 65 | + |
| 66 | +- Credit the contributors involved in this change. The name of the |
| 67 | + people that wrote the patch should be included, as well as other |
| 68 | + contributors having made significant non-coding contributions (code |
| 69 | + review, testing, etc.). |
| 70 | + |
| 71 | +[[change-summary]] |
| 72 | +==== Release change summary ==== |
| 73 | + |
| 74 | +Write a full-text summary of the changes in the release, less detailed |
| 75 | +than the full change entries. This text should be a between one |
| 76 | +sentence and a couple paragraphs long, and will be included in the |
| 77 | +Github description of the release and email announcements. |
| 78 | + |
| 79 | +The release change summary should go in the section of the release, |
| 80 | +above the list of change entries. |
| 81 | + |
| 82 | +=== Picking a version number === |
| 83 | + |
| 84 | +Choose the next version number. You should try to respect |
| 85 | +http://semver.org/[Semantic Versioning] whenever possible: point |
| 86 | +releases should have bugfixes and tweaks only, and minor releases |
| 87 | +should not break backward compatibility. |
| 88 | + |
| 89 | +=== Update sources with new version number === |
| 90 | + |
| 91 | +During development we use +NEXT_RELEASE+ as a placeholder for the next |
| 92 | +release number, so any occurence of +NEXT_RELEASE+ in the development |
| 93 | +repository should be replaced by this version number. There is at |
| 94 | +least one such occurence in the 'Changes' file. |
| 95 | + |
| 96 | +Furthermore, the version coded is hardcoded in some parts of the |
| 97 | +codebase and needs to be updated: |
| 98 | + |
| 99 | +- the 'VERSION' file contains the current version number, with no |
| 100 | + ending newline |
| 101 | + |
| 102 | +- the 'META' file contains the current version number to inform ocamlfind |
| 103 | + |
| 104 | +You can use +git grep+ to look for all occurrences of +NEXT_RELEASE+ |
| 105 | +and a given version number, from the root of the repository: |
| 106 | + |
| 107 | +---- |
| 108 | +git grep NEXT_RELEASE |
| 109 | +git grep -F "0.9" |
| 110 | +---- |
| 111 | + |
| 112 | +== Doing the release == |
| 113 | + |
| 114 | +These steps should be performed by someone with push access to the |
| 115 | +central git repository. |
| 116 | + |
| 117 | +=== Marking the release day in Changes === |
| 118 | + |
| 119 | +Mark the current release day in the Changes file. |
| 120 | + |
| 121 | + |
| 122 | +=== Performing the release through github === |
| 123 | + |
| 124 | +Github's interface allows to create a release tag and publish |
| 125 | +a release. From the https://github.com/ocaml/ocamlbuild[github project |
| 126 | +page] you can go to the |
| 127 | +https://github.com/ocaml/ocamlbuild/releases[release tab] which lists |
| 128 | +the current tags and has |
| 129 | +a https://github.com/ocaml/ocamlbuild/releases/new[draft a new |
| 130 | +release] button. Clicking this button (or the latter link in the |
| 131 | +previous sentence) will let you pick a tag name, release title, and |
| 132 | +description. |
| 133 | + |
| 134 | +The tag name should be just the release version number. See +git |
| 135 | +tag --list+ to see existing tags from a command-line. The release name |
| 136 | +should be just +Release <version-number>+. The description should be |
| 137 | +the Changes section corresponding to the release (release summary and |
| 138 | +detailed list of entries). |
| 139 | + |
| 140 | +==== Releasing from the command-line instead ==== |
| 141 | + |
| 142 | +If you prefer, you can also perform the same steps using the |
| 143 | +command-line: |
| 144 | + |
| 145 | +---- |
| 146 | +git tag <VERSION> -a |
| 147 | +---- |
| 148 | + |
| 149 | +This command should start an editor to ask for a tag message. You can |
| 150 | +use the <<change-summary,release change summary>> as the tag message. |
| 151 | + |
| 152 | +---- |
| 153 | +git push --tags origin |
| 154 | +---- |
| 155 | + |
| 156 | +Note that if you use a different remote name than +origin+ you should |
| 157 | +use it there. |
| 158 | + |
| 159 | +== Making the release visible to our users == |
| 160 | + |
| 161 | +[[opam-repo]] |
| 162 | +=== opam-repository update === |
| 163 | + |
| 164 | +You should create a new opam package for the new version. For this, |
| 165 | +clone the opam-repository |
| 166 | +https://github.com/ocaml/opam-repository/[upstream repository], go to |
| 167 | +https://github.com/ocaml/opam-repository/tree/master/packages/ocamlbuild/['packages/ocamlbuild'] |
| 168 | +and create a new repository 'ocamlbuild.<VERSION>'; you need three |
| 169 | +files in this repository: |
| 170 | + |
| 171 | +- 'descr', a full-text description of the package: just copy the |
| 172 | + previous version's file. |
| 173 | + |
| 174 | +- 'url', which tells opam how to download an archive; you can copy the |
| 175 | + previous version's file, and you need to update the two fields. It |
| 176 | + looks like this: |
| 177 | ++ |
| 178 | +---- |
| 179 | +archive: "https://github.com/ocaml/ocamlbuild/archive/0.9.0.tar.gz" |
| 180 | +checksum: "71c813d51bed39e73937dd4751d593c6" |
| 181 | +---- |
| 182 | ++ |
| 183 | +The +archive+ is the file built by github at |
| 184 | ++https://github.com/ocaml/ocamlbuild/archive/<tag-name>.tar.gz+. To |
| 185 | +compute the checksum, fetch this file and compute its md5 sum; your |
| 186 | +system may have a +md5sum+ command to do this. |
| 187 | + |
| 188 | +- 'opam': this should be just a copy of the 'opam' file at the root of |
| 189 | + the ocamlbuild repository -- which should have been |
| 190 | + <<synch-opam-files,kept in synch>> with upstream packaging |
| 191 | + changes -- with the +version+ field changed from +"dev"+ to the |
| 192 | + current version number. |
| 193 | + |
| 194 | +=== announcing the release === |
| 195 | + |
| 196 | +You can send an email to the caml-list. The tradition is to use the subject |
| 197 | + |
| 198 | + [ANN] OCamlbuild <version number> |
| 199 | + |
| 200 | +The mail could be just the release change summary and the detailed |
| 201 | +list of change entries. Feel free to add other content according to |
| 202 | +your personal preference. |
0 commit comments