xref: /libCEED/RELEASING.md (revision 2aa7bb50f48570326aa35e6f36f3e770c8ff30cb)
1ead10094SWill Pazner# Release Procedures
2ead10094SWill Pazner
3*2aa7bb50SJed Brown*These notes are meant for a maintainer to create official releases.*
4ff0d35f1Sjeremylt
5*2aa7bb50SJed BrownIn preparing a release, create a branch to hold pre-release commits. We ideally want all release mechanics (for all languages) to be in one commit, which will then be tagged. (This will change if/when we stop synchronizing releases across all language bindings.)
6*2aa7bb50SJed Brown
7*2aa7bb50SJed Brown## Core C library
8*2aa7bb50SJed Brown
9*2aa7bb50SJed BrownSome minor bookkeeping updates are needed when releasing a new version of the core library.
10ff0d35f1Sjeremylt
11ff0d35f1SjeremyltThe version number must be updated in
12ff0d35f1Sjeremylt
13ff0d35f1Sjeremylt* `include/ceed/ceed.h`
14ff0d35f1Sjeremylt* `ceed.pc.template`
15ff0d35f1Sjeremylt* `Doxyfile`
16ff0d35f1Sjeremylt
17*2aa7bb50SJed Brownas well as `include/ceed/ceed.h` (`CEED_VERSION_MAJOR`, `CEED_VERSION_MINOR`).
18*2aa7bb50SJed Brown
19*2aa7bb50SJed BrownAdditionally, the release notes in `doc/sphinx/source/releasenotes.rst` should be updated. Use `git log --first-parent v0.7..` to get a sense of the pull requests that have been merged and thus might warrant emphasizing in the release notes. While doing this, gather a couple sentences for key features to highlight on [GitHub releases](https://github.com/CEED/libCEED/releases). The "Current Main" heading needs to be named for the release.
20*2aa7bb50SJed Brown
21*2aa7bb50SJed BrownUse `make doc-latexpdf` to build a PDF users manual and inspect it for missing references or formatting problems (e.g., with images that were converted to PDF). This contains the same content as the website, but will be archived on Zenodo.
22*2aa7bb50SJed Brown
23*2aa7bb50SJed Brown### Quality control and good citizenry
24*2aa7bb50SJed Brown
25*2aa7bb50SJed Brown1. If making a minor release, check for API and ABI changes that could break [semantic versioning](https://semver.org/). The [ABI compliance checker](https://github.com/lvc/abi-compliance-checker) is a useful tool, as is `nm -D libceed.so` and checking for public symbols (capital letters like `T` and `D` that are not namespaced).
26*2aa7bb50SJed Brown
27*2aa7bb50SJed Brown2. Double check testing on any architectures that may not be exercised in continuous integration (e.g., HPC facilities) and with users of libCEED, such as MFEM and PETSc applications. While unsupported changes do not prevent release, it's polite to make a PR to support the new release, and it's good for quality to test before taggin a libCEED release.
28*2aa7bb50SJed Brown
29*2aa7bb50SJed Brown3. Update and test all the language bindings (see below) within the branch.
30*2aa7bb50SJed Brown
31*2aa7bb50SJed Brown4. Check that `spack install libceed@develop` works prior to tagging. The Spack `libceed/package.py` file should be updated immediately after tagging a release.
32*2aa7bb50SJed Brown
33*2aa7bb50SJed Brown### Tagging and releasing on GitHub
34*2aa7bb50SJed Brown
35*2aa7bb50SJed Brown0. Confirm all the steps above, including all language bindings.
36*2aa7bb50SJed Brown1. `git commit -am'libCEED 0.8.1'`
37*2aa7bb50SJed BrownMore frequently, this is amending the commit message on an in-progress commit, after rebasing if applicable on latest `main`.
38*2aa7bb50SJed Brown2. `git push` updates the PR holding release; opportunity for others to review
39*2aa7bb50SJed Brown3. `git switch main && git merge --ff-only HEAD@{1}` fast-forward merge into `main`
40*2aa7bb50SJed Brown4. `git tag --sign -m'libCEED 0.8.1'`
41*2aa7bb50SJed Brown5. `git push origin main v0.8.1`
42*2aa7bb50SJed Brown6. Draft a [new release on GitHub](https://github.com/CEED/libCEED/releases), using a few sentences gathered from the release notes.
43*2aa7bb50SJed Brown7. Submit a PR to Spack.
44*2aa7bb50SJed Brown8. Publish Julia, Python, and Rust packages.
45*2aa7bb50SJed Brown
46*2aa7bb50SJed Brown### Archive Users Manual on Zenodo
47*2aa7bb50SJed Brown
48*2aa7bb50SJed BrownGenerate the PDF using `make doc-latexpdf`, click "New version" on the [Zenodo
49*2aa7bb50SJed Brownrecord](https://zenodo.org/record/4302737) and upload. Update author info if applicable (new
50*2aa7bb50SJed Brownauthors, or existing authors changing institutions). Make a new PR to update the version
51*2aa7bb50SJed Brownnumber and DOI in `README.rst` and `doc/bib/references.bib`.
52ff0d35f1Sjeremylt
53ead10094SWill Pazner## Julia
54ead10094SWill Pazner
55ead10094SWill PaznerlibCEED's Julia interface (LibCEED.jl) has two components:
56ead10094SWill Pazner
57ead10094SWill Pazner* LibCEED.jl, the user-facing package that contains the Julia interface.
58ead10094SWill Pazner* libCEED_jll, a binary wrapper package ("jll package") that contains prebuilt binaries of the
59ead10094SWill Pazner  libCEED library for various architectures.
60ead10094SWill Pazner
61ead10094SWill PaznerWhen there is a new release of libCEED, both of these components need to be updated. First,
62ead10094SWill PaznerlibCEED_jll is updated, and then LibCEED.jl.
63ead10094SWill Pazner
64ead10094SWill Pazner### Updating libCEED_jll
65ead10094SWill Pazner
66ead10094SWill PaznerThe binary wrapper package libCEED_jll is updated by making a pull request against
67ead10094SWill Pazner[Yggdrasil](https://github.com/JuliaPackaging/Yggdrasil), the Julia community build tree. In this
68ead10094SWill PaznerPR, the file `L/libCEED/build_tarballs.jl` should be changed to update version number and change the
69ead10094SWill Paznerhash of the libCEED commit to use to build the binaries, similar to the following diff:
70ead10094SWill Pazner```diff
71ead10094SWill Paznerdiff --git a/L/libCEED/build_tarballs.jl b/L/libCEED/build_tarballs.jl
72ead10094SWill Pazner--- a/L/libCEED/build_tarballs.jl
73ead10094SWill Pazner+++ b/L/libCEED/build_tarballs.jl
74ead10094SWill Pazner@@ -3,11 +3,11 @@
75ead10094SWill Pazner using BinaryBuilder, Pkg
76ead10094SWill Pazner
77ead10094SWill Pazner name = "libCEED"
78ead10094SWill Pazner-version = v"0.7.0"
79ead10094SWill Pazner+version = v"0.8.0"
80ead10094SWill Pazner
81ead10094SWill Pazner # Collection of sources required to complete build
82ead10094SWill Pazner sources = [
83ead10094SWill Pazner-    GitSource("https://github.com/CEED/libCEED.git", "06988bf74cc6ac18eacafe7930f080803395ba29")
84ead10094SWill Pazner+    GitSource("https://github.com/CEED/libCEED.git", "e8f234590eddcce2220edb1d6e979af7a3c35f82")
85ead10094SWill Pazner ]
86ead10094SWill Pazner```
87ead10094SWill PaznerAfter the PR is merged into Yggdrasil, the new version of libCEED_jll will automatically be
88ead10094SWill Paznerregistered, and then we can proceed to update LibCEED.jl.
89ead10094SWill Pazner
90ead10094SWill Pazner### Updating LibCEED.jl
91ead10094SWill Pazner
92ead10094SWill PaznerAfter the binary wrapper package libCEED_jll has been updated, we are ready to update the main Julia
93ead10094SWill Paznerinterface LibCEED.jl. This requires updating the file `julia/LibCEED.jl/Project.toml` in the libCEED
94ead10094SWill Paznerrepository. The version number should be incremented, and the dependency on the updated version of
95ead10094SWill PaznerlibCEED_jll should be listed:
96ead10094SWill Pazner```diff
97ead10094SWill Paznerdiff --git a/julia/LibCEED.jl/Project.toml b/julia/LibCEED.jl/Project.toml
98ead10094SWill Pazner--- a/julia/LibCEED.jl/Project.toml
99ead10094SWill Pazner+++ b/julia/LibCEED.jl/Project.toml
100ead10094SWill Pazner@@ -1,7 +1,7 @@
101ead10094SWill Pazner name = "LibCEED"
102ead10094SWill Pazner uuid = "2cd74e05-b976-4426-91fa-5f1011f8952b"
103ead10094SWill Pazner-version = "0.1.0"
104ead10094SWill Pazner+version = "0.1.1"
105ead10094SWill Pazner
106ead10094SWill Pazner [deps]
107ead10094SWill Pazner CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
108ead10094SWill Pazner@@ -26,4 +26,4 @@ Cassette = "0.3"
109ead10094SWill Pazner Requires = "1"
110ead10094SWill Pazner StaticArrays = "0.12"
111ead10094SWill Pazner UnsafeArrays = "1"
112ead10094SWill Pazner-libCEED_jll = "0.7"
113ead10094SWill Pazner+libCEED_jll = "0.8"
114ead10094SWill Pazner```
115ead10094SWill PaznerOnce this change is merged into libCEED's `main` branch, the updated package version can be
116ead10094SWill Paznerregistered using the GitHub registrator bot by commenting on the commit:
117ead10094SWill Pazner
118446df8bcSWill Pazner> @JuliaRegistrator register branch=main subdir=julia/LibCEED.jl
119ead10094SWill Pazner
120*2aa7bb50SJed BrownAt this point, the bot should create a PR against the [general Julia
121ead10094SWill Paznerregistry](https://github.com/JuliaRegistries/General), which should be merged automatically after a
122ead10094SWill Paznershort delay.
1232475aa4cSWill Pazner
1242475aa4cSWill Pazner### Moving development tests to release tests
1252475aa4cSWill Pazner
1262475aa4cSWill PaznerLibCEED.jl has both _development_ and _release_ unit tests. The _release_ tests are run both with
1272475aa4cSWill Paznerthe current build of libCEED, and with the most recent release of libCEED_jll. The _development_
1282475aa4cSWill Paznertests may use features which were not available in the most recent release, and so they are only run
1292475aa4cSWill Paznerwith the current build of libCEED.
1302475aa4cSWill Pazner
1312475aa4cSWill PaznerUpon release, the development tests may be moved to the release tests, so that these features will
1322475aa4cSWill Paznerbe tested against the most recent release of libCEED_jll. The release tests are found in the file
1332475aa4cSWill Pazner`julia/LibCEED.jl/test/runtests.jl` and the development tests are found in
1342475aa4cSWill Pazner`julia/LibCEED.jl/test/rundevtests.jl`.
135ff0d35f1Sjeremylt
136ff0d35f1Sjeremylt## Python
137ff0d35f1Sjeremylt
138*2aa7bb50SJed BrownThe Python package gets its version from `ceed.pc.template` so there are no file modifications necessary.
139*2aa7bb50SJed Brown
140*2aa7bb50SJed Brown1. `make wheel` builds and tests the wheels using Docker. See the [manylinux repo](https://github.com/pypa/manylinux) for source and usage inforamtion. If this succeeds, the completed wheels are in `wheelhouse/libceed-0.8-cp39-cp39-manylinux2010_x86_64.whl`.
141*2aa7bb50SJed Brown2. Manually test one or more of the wheels by creating a virtualenv and using `pip install wheelhouse/libceed-0.8-cp39-cp39-manylinux2010_x86_64.whl`, then `python -c 'import libceed'` or otherwise running tests.
142*2aa7bb50SJed Brown3. Create a `~/.pypirc` with entries for `testpypi` (`https://test.pypi.org/legacy/`) and the real `pypi`.
143*2aa7bb50SJed Brown4. Upload to `testpypi` using
144*2aa7bb50SJed Brown```console
145*2aa7bb50SJed Brown$ twine upload --repository testpypi wheelhouse/libceed-0.8-cp39-cp39-manylinux2010_x86_64.whl
146*2aa7bb50SJed Brown```
147*2aa7bb50SJed Brown5. Test installing on another machine/in a virtualenv:
148*2aa7bb50SJed Brown```console
149*2aa7bb50SJed Brown$ pip install --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple libceed
150*2aa7bb50SJed Brown```
151*2aa7bb50SJed BrownThe `--extra-index-url` argument allows dependencies like `cffi` and `numpy` from being fetched from the non-test repository.
152*2aa7bb50SJed Brown6. Do it live:
153*2aa7bb50SJed Brown```console
154*2aa7bb50SJed Brown$ twine upload --repository pypi wheelhouse/libceed-0.8-cp39-cp39-manylinux2010_x86_64.whl
155*2aa7bb50SJed Brown```
156*2aa7bb50SJed BrownNote that this cannot be amended.
157ff0d35f1Sjeremylt
158ff0d35f1Sjeremylt## Rust
159ff0d35f1Sjeremylt
160*2aa7bb50SJed BrownThe Rust crates for libCEED are split into
161*2aa7bb50SJed Brown1. [`libceed-sys`](https://crates.io/crates/libceed-sys), which handles building/finding the `libceed.so` or `libceed.a` library and providing unsafe Rust bindings (one to one with the C interface, using C FFI datatypes)
162*2aa7bb50SJed Brown2. [`libceed`](https://crates.io/crates/libceed) containing the safe and idiomatic Rust bindings.
163*2aa7bb50SJed Brown
164*2aa7bb50SJed BrownWe currently apply the same version number across both of these crates. There are some tests for version strings matching, but in short, one needs to update the following locations.
165*2aa7bb50SJed Brown
166*2aa7bb50SJed Brown```console
167*2aa7bb50SJed Brown$ git grep '0\.8' -- rust/
168*2aa7bb50SJed Brownrust/libceed-sys/Cargo.toml:version = "0.8.0"
169*2aa7bb50SJed Brownrust/libceed-sys/README.md:libceed-sys = "0.8.0"
170*2aa7bb50SJed Brownrust/libceed-sys/build.rs:        .atleast_version("0.8")
171*2aa7bb50SJed Brownrust/libceed/Cargo.toml:version = "0.8.0"
172*2aa7bb50SJed Brownrust/libceed/Cargo.toml:libceed-sys = { version = "0.8", path = "../libceed-sys" }
173*2aa7bb50SJed Brownrust/libceed/README.md:libceed = "0.8.0"
174*2aa7bb50SJed Brown```
175*2aa7bb50SJed Brown
176*2aa7bb50SJed BrownAfter doing this,
177*2aa7bb50SJed Brown
178*2aa7bb50SJed Brown1. `cargo package --list` to see that the file list makes sense.
179*2aa7bb50SJed Brown2. `cargo package` to build crates locally
180*2aa7bb50SJed Brown3. `cargo publish` to publish the crates to https://crates.io
181