• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2Copyright: © 2021 SANE Project
3SPDX-License-Identifier: CC-BY-SA-4.0
4---
5
6# Creating A New `sane-backends` Release
7
8This file summarizes most points to pay attention to when planning for
9a new `sane-backends` release.  Content has been checked while working
10on `$old_version` and getting ready for `$new_version`, where:
11
12``` sh
13old_version=1.0.31
14new_version=1.0.32
15```
16
17## Timetable
18
19It is easiest to pick a release date well in advance so everyone knows
20what to expect.  Ignoring security bug fix releases, `sane-backends`
21has been released on a roughly half-yearly schedule since `1.0.28`.
22
23Once you pick a date (and time), say `DT`, the planning is simply a
24matter of counting back from there:
25
26 - `$DT -  0 days`: **release** :confetti_ball:
27 - `$DT - 21 days`: **branch off** after which the release branch will not get any new features,
28   only bug fixes and translations.
29 - `$DT - 35 days`: **schedule announcement** including the timetable.
30
31Feel free to adjust the offsets if that works better.  Also, pinging
32on the mailing list well in advance, say two, three months, about a
33suitable date for everyone involved is a good idea.
34
35> If you mention time of day, on the mailing list, in issues or merge
36> requests, use UTC times and mention that, e.g. 09:00 UTC.  People
37> are in time zones all over the place and converting to and from UTC
38> should be relatively easy for everyone.  Converting from other
39> time zones is generally cumbersome, even without things like DST.
40
41## Schedule Announcement
42
43Send an announcement to the `sane-devel` mailing list announcing the schedule.
44
45All notable changes are tracked as separate files in the newsfragments directory which means there's
46no need to track them manually.
47
48## Branch off
49
50A separate branch for the upcoming release is created on the repository. This marks the point when
51the code for the release effectively enters a feature freeze and no new features will land into
52the release branch.
53
54Use branch in the format of `release-1.2.x` so that it's clear that further bugfix releases will
55happen on that branch.
56
57Notify `sane-devel` of the Branch Off and point out that merge requests that have to be included
58in the upcoming release need to be targeted at release branch. Anything else can go to `master` as
59usual.
60
61For backends added since the `$old_version`, make sure that its
62`.desc` file includes a `:new :yes` near the top.  You can find such
63backends from the list of added files with:
64
65``` sh
66git ls-files -- backend | while read f; do
67  git log --follow --diff-filter=A --find-renames=40% \
68          --format="%ai  $f" $old_version..release/$new_version -- "$f"
69done | cat
70```
71
72Feature changes are no longer allowed, bar exceptional circumstances, so now is a good time to
73sync the `po/*.po` files in the repository for translators.
74
75Announce the Branch Off on `sane-devel` and invite translators to contribute their updates.
76Release manager should ensure that whichever branch the translator work on, their work lands on
77both the release branch and the master branch.
78
79Occasionally, you may notice changes that have not been documented,
80either in a `.desc` file or a manual page.  Now is a good time to
81rectify the omission.
82
83The `NEWS` file is updated during the release time, there's no need to do anything with the
84release notes now.
85
86## Release
87
88The release consists of two parts: a release notes MR and the actual release.
89
90The release notes are handled by the towncrier tool. The easiest way to use it is from virtualenv:
91
92``` sh
93virtualenv some/path/to/virtualenv
94source some/path/to/virtualenv
95pip install towncrier
96```
97
98To update the `NEWS `document, run the following:
99
100```
101towncrier --version $new_version --date `date -u  +%F`
102```
103
104After that, create a new MR, merge it and fetch the new release branch.
105
106The actual release is as easy as pushing a tag and clicking a web UI button.  GitLab CI/CD
107takes care of the rest.
108
109``` sh
110git tag -a -s $new_version -m "Release $new_version"
111git push --tags origin release-$new_release
112```
113
114The final job in the release pipeline that is triggered by the above
115is a manual job.  You have to press a button in the web UI.  However,
116before you do so, create a Personal Access Token (with `api` scope) in
117your own GitLab account's `Settings` > [`Access Tokens`][] and use its
118value to set the `PRIVATE_TOKEN` variable for the `upload` job in the
119`Release` stage.  You need to set this on the page that triggers the
120`upload` job.
121
122 [`Access Tokens`]: https://gitlab.com/-/profile/personal_access_tokens
123 [`CI/CD`]: https://gitlab.com/sane-project/backends/-/settings/ci_cd
124
125### Updating The Website
126
127After the release artifacts, i.e. the source tarball, have hit the
128GitLab [Release][] tab, grab the source tarball to create updated
129lists of supported devices and HTML manual pages for the website.
130
131With the `$new_version`'s source tarball:
132
133``` sh
134tar xaf sane-backends-$new_version.tar.gz@
135cd sane-backends-$new_version
136./configure
137make -C lib
138make -C sanei
139make -C doc html-pages
140LANG=C make -C doc html-man
141```
142
143The last command assumes you have `man2html` in your `$PATH`.  There
144are various versions of this command but `make` assumes you are using
145the version from one of:
146
147- https://savannah.nongnu.org/projects/man2html/
148- https://web.archive.org/web/20100611002649/http://hydra.nac.uci.edu/indiv/ehood/tar/man2html3.0.1.tar.gz
149
150Using anything else is asking for trouble.
151
152> See also #261.
153
154With the various HTML pages generated in `sane-backends-$new_version`,
155check out the latest code of the sane-project/website and:
156
157``` sh
158cd website
159rm man/*
160cp .../sane-backends-$new_version/doc/*.[1578].html man/
161git add man/
162git mv sane-backends.html sane-backends-$old_version.html
163cp .../sane-backends-$new_version/doc/sane-{backends,mfgs}.html .
164git add sane-{backends,mfgs}.html
165```
166
167Next, add a hyperlink to the `$old_version`'s file in
168`sane-supported-devices.html` and add an entry for the new release to
169`index.html`.
170
171Finally
172
173``` sh
174git add sane-supported-devices.html index.html
175git commit -m "Update for sane-backends-$new_version release"
176git push
177```
178
179The push will trigger a GitLab CI/CD pipeline that will update the
180website.  Make sure it succeeds (see sane-project/website#33 for one
181reason it might fail).
182
183 [Release]: https://gitlab.com/sane-project/backends/-/releases
184
185### Mailing List Announcement
186
187Once the website has been updated successfully, announce the release
188on the `sane-announce` mailing list (and Cc: `sane-devel`).  You may
189want to ping the `sane-announce` list's moderator (@kitno455) to get
190your post approved sooner rather than later.
191
192## Post-Release
193
194With the release all done, there are still a few finishing touches that need taking care of:
195
196* remove the `:new` tag from all `doc/descriptions*/*.desc` files
197* update this file!
198
199That's All Folks!
200