Debian Codegraph @

release_tools/README.adoc

raw
1 = How to perform a semi-automatic release =
2
3 == Prerequisities ==
4
5 * System with `python3.6` or greater, installed https://pypi.python.org/pypi/PyGithub/1.35[PyGithub] module.
6 * A GitHub token - get one on https://github.com/settings/tokens. Choose `repo` scope.
7
8
9 == Process ==
10
11 When releasing alpha/pre-releases, please keep in mind how RPM handles the versioning. Please see how is this handled in SPEC file https://fedoraproject.org/wiki/Packaging:Versioning before you build Fedora and RHEL packages.
12
13 . Ensure the project is in a good shape for the release
14 +
15 * Check CI is passing in https://github.com/OpenSCAP/openscap/actions?query=branch%3Amain+event%3Apush[GitHub Actions]
16 * Check builds in https://dashboard.packit.dev/projects/github.com/OpenSCAP/openscap[Packit] are successful.
17
18 . Clone a clean `openscap` repository:
19
20 git clone --recurse-submodules [email protected]:OpenSCAP/openscap.git
21
22 . Create `.env` file
23 +
24 You are supposed to define environment variables that contain sensitive information, s.a. GitHub access tokens.
25 Create an `.env` file in the `release_tools` directory (i.e. where the release scripts are).
26 Put your GitHub token in the `.env` file, so it contains the following line:
27
28 GITHUB_TOKEN='<your token here>'
29
30 . Check out that the information within `versions.sh` is accurate.
31 +
32 This file contains some variables that differ among the releases:
33 +
34 * `version`
35 * `previous_version`
36
37 +
38 OpenSCAP versions are supposed to have correct values from the previous build (see the step 6).
39
40 . Run `up_to_compliance_check.sh`.
41 +
42 This script automatically performs the following actions:
43
44 * Build and check build, execute CTest locally
45 * Check Python bindings
46 * Perform ABI compliance check
47
48 +
49 In the ideal case, the script ends after the ABI compatiblity check finishes.
50 Review the check results and act accordingly to them.
51 Read the report, if there is an ABI issue (some symbols were changed / removed), fix it before proceeding further!
52
53 . Run `handle_ltversions.sh`.
54 +
55 According to the result from the compliance check (and the decision what to do about possible API/ABI changes), you run the script with an argument `bugfix`, `backwards_compatible` or `breaking_change`.
56 +
57 Use this guideline to decide:
58 +
59 * `bugfix`: No changes of API/ABI, the code got just some improvements under the hood.
60 * `backwards_compatible`: API/ABI is backwards compatible - the API was expanded, new symbols were introduced.
61 * `breaking_change`: API/ABI is not backwards compatible - the API was modified, symbols were removed, types have changed... If this happens, think about dropping symbols marked with openscap `OSCAP_DEPRECATED()` macro.
62
63 +
64 This changes the libtool library version number so it reflects the API/ABI change.
65 The version number is changed in the following way:
66 * adjusts `LT_CURRENT`, `LT_REVISION`, `LT_AGE``
67 * version is current:revision:age -http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
68 * resulting soname will be (`LT_CURRENT-LT_AGE`.`LT_AGE`.`LT_REVISION`)
69 * Run `ls -al src/.libs/`, check the `libopenscap.so` version afterwards. Ensure that `libopenscap.so` has been built with new soname. Twice.
70
71 . Perform scratch builds.
72 +
73 Run `make package_source` and perform a scratch build on Fedora and RHEL in order to verify that the prepared OpenSCAP upstream release will be able to be built and packaged in these Linux distributions.
74 +
75 You have to be a Fedora packager in order to be able to perform Fedora scratch builds.
76
77 make package_source
78 cp openscap-$version.tar.gz ~/fedora-packages/openscap/
79 cd ~/fedora-packages/openscap/
80 rpmdev-bumpspec -c "upgrade to the latest upstream release" \
81 -n $version openscap.spec
82 fedpkg build --scratch --srpm
83 +
84 Use an analogous process also for RHEL.
85 +
86 If something went seriously wrong with the tests (e.g. a very bad pointer handling was revealed), you may want to abort the release process and fix those problems first.
87
88 . Update the NEWS and make the release commit.
89 +
90 Make sure that everything in the repository is in place, and that the only thing missing is the `NEWS` file and tags.
91 Use the `news_template.sh` script to generate a starting point for your `NEWS` file.
92 Update the `AUTHORS` file for missing authors and the `naming.sh` file if there are duplicate author entries.
93 +
94 Use it to update the `NEWS` file and commit it.
95 +
96 The last commit before the release has to have the `openscap-<version>` message (e.g. `openscap-1.3.2`).
97 +
98 Tag the commit and push the changes to upstream. You need to be allowed to push without pull requests in the GitHub repository settings.
99 +
100 git tag $version
101 git push origin main
102
103 . Create tarballs and GitHub release.
104 +
105 In a clean copy of the release branch run `cmake .. && make package_source` in the `build` directory.
106 +
107 Create new GitHub release with the name of the version being released.
108 +
109 Add relevant part of the NEWS file as a release description.
110 +
111 Attach `openscap-X.Y.Z.tar.gz` and `openscap-X.Y.Z.tag.gz.sha512` files to the GH release, created against the release tag.
112
113 . Run `new-release.sh $new_version`.
114 +
115 You need to provide the expected next version, ie. if you release 1.3.7 you should put there 1.3.8.
116 This will handle milestones swap on GitHub and it will bump version numbers in `versions.sh` to be ready for the next upstream release.
117 +
118 Then, change the version to expected next version in `/CMakeLists.txt`
119 +
120 Commit and push the changes.
121
122 . Generate and publish documentation.
123 +
124 Generate documentation by running `cmake -DENABLE_DOCS=ON .. && make docs`. Then, upload the generated OpenSCAP User manual and Doxygen API documentation to https://static.open-scap.org/ (Ask project maintainers for information on how to update https://static.open-scap.org/).
125
126 . Build packages for RHEL and Fedora.
127
128 . Send announcement.
129 +
130 Check out https://www.redhat.com/archives/open-scap-list/2017-August/msg00001.html for template. If the release is exciting, tweet it on twitter!
131
132 . Merge maintenance branch into main.
133 +
134 It is the best timing to merge just after release.