xref: /libCEED/RELEASING.md (revision 30b49de6ae586e8c9c70e8509fd1b20717724244)
1ead10094SWill Pazner# Release Procedures
2ead10094SWill Pazner
32aa7bb50SJed Brown*These notes are meant for a maintainer to create official releases.*
4ff0d35f1Sjeremylt
517be3a41SJeremy L ThompsonIn preparing a release, create a branch to hold pre-release commits.
617be3a41SJeremy L ThompsonWe ideally want all release mechanics (for all languages) to be in one commit, which will then be tagged.
717be3a41SJeremy L Thompson(This will change if/when we stop synchronizing releases across all language bindings.)
82aa7bb50SJed Brown
92aa7bb50SJed Brown## Core C library
102aa7bb50SJed Brown
112aa7bb50SJed BrownSome minor bookkeeping updates are needed when releasing a new version of the core library.
12ff0d35f1Sjeremylt
13ff0d35f1SjeremyltThe version number must be updated in
14ff0d35f1Sjeremylt
1549aac155SJeremy L Thompson* `include/ceed.h`
16ff0d35f1Sjeremylt* `ceed.pc.template`
17ff0d35f1Sjeremylt* `Doxyfile`
1877ac943eSJeremy L Thompson* `CITATION.cff`
19ff0d35f1Sjeremylt
208ec64e9aSJed BrownAdditionally, the release notes in `doc/sphinx/source/releasenotes.md` should be updated.
2117be3a41SJeremy L ThompsonUse `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.
2217be3a41SJeremy L ThompsonWhile doing this, gather a couple sentences for key features to highlight on [GitHub releases](https://github.com/CEED/libCEED/releases).
2317be3a41SJeremy L ThompsonThe "Current Main" heading needs to be named for the release.
242aa7bb50SJed Brown
2517be3a41SJeremy L ThompsonUse `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).
2617be3a41SJeremy L ThompsonThis contains the same content as the website, but will be archived on Zenodo.
272aa7bb50SJed Brown
282aa7bb50SJed Brown### Quality control and good citizenry
292aa7bb50SJed Brown
3017be3a41SJeremy L Thompson1. If making a minor release, check for API and ABI changes that could break [semantic versioning](https://semver.org/).
3117be3a41SJeremy L ThompsonThe [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).
322aa7bb50SJed Brown
3317be3a41SJeremy L Thompson2. 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.
348ec64e9aSJed BrownWhile 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 tagging a libCEED release.
352aa7bb50SJed Brown
362aa7bb50SJed Brown3. Update and test all the language bindings (see below) within the branch.
372aa7bb50SJed Brown
3817be3a41SJeremy L Thompson4. Check that `spack install libceed@develop` works prior to tagging.
3917be3a41SJeremy L ThompsonThe Spack `libceed/package.py` file should be updated immediately after tagging a release.
402aa7bb50SJed Brown
412aa7bb50SJed Brown### Tagging and releasing on GitHub
422aa7bb50SJed Brown
432aa7bb50SJed Brown0. Confirm all the steps above, including all language bindings.
442aa7bb50SJed Brown1. `git commit -am'libCEED 0.8.1'`
452aa7bb50SJed BrownMore frequently, this is amending the commit message on an in-progress commit, after rebasing if applicable on latest `main`.
462aa7bb50SJed Brown2. `git push` updates the PR holding release; opportunity for others to review
472aa7bb50SJed Brown3. `git switch main && git merge --ff-only HEAD@{1}` fast-forward merge into `main`
482aa7bb50SJed Brown4. `git tag --sign -m'libCEED 0.8.1'`
492aa7bb50SJed Brown5. `git push origin main v0.8.1`
502aa7bb50SJed Brown6. Draft a [new release on GitHub](https://github.com/CEED/libCEED/releases), using a few sentences gathered from the release notes.
512aa7bb50SJed Brown7. Submit a PR to Spack.
522aa7bb50SJed Brown8. Publish Julia, Python, and Rust packages.
532aa7bb50SJed Brown
542aa7bb50SJed Brown### Archive Users Manual on Zenodo
552aa7bb50SJed Brown
5617be3a41SJeremy L ThompsonGenerate the PDF using `make doc-latexpdf`, click "New version" on the [Zenodo record](https://zenodo.org/record/4302737) and upload.
5717be3a41SJeremy L ThompsonUpdate author info if applicable (new authors, or existing authors changing institutions).
5817be3a41SJeremy L ThompsonMake a new PR to update the version number and DOI in `README.rst` and `doc/bib/references.bib`.
59ff0d35f1Sjeremylt
60ead10094SWill Pazner## Julia
61ead10094SWill Pazner
62ead10094SWill PaznerlibCEED's Julia interface (LibCEED.jl) has two components:
63ead10094SWill Pazner
64ead10094SWill Pazner* LibCEED.jl, the user-facing package that contains the Julia interface.
6517be3a41SJeremy L Thompson* libCEED_jll, a binary wrapper package ("jll package") that contains prebuilt binaries of the   libCEED library for various architectures.
66ead10094SWill Pazner
6717be3a41SJeremy L ThompsonWhen there is a new release of libCEED, both of these components need to be updated.
6817be3a41SJeremy L ThompsonFirst, libCEED_jll is updated, and then LibCEED.jl.
69ead10094SWill Pazner
70ead10094SWill Pazner### Updating libCEED_jll
71ead10094SWill Pazner
7217be3a41SJeremy L ThompsonThe binary wrapper package libCEED_jll is updated by making a pull request against [Yggdrasil](https://github.com/JuliaPackaging/Yggdrasil), the Julia community build tree.
7317be3a41SJeremy L ThompsonIn this PR, the file `L/libCEED/build_tarballs.jl` should be changed to update version number and change the hash of the libCEED commit to use to build the binaries, similar to the following diff:
74ead10094SWill Pazner```diff
75ead10094SWill Paznerdiff --git a/L/libCEED/build_tarballs.jl b/L/libCEED/build_tarballs.jl
76ead10094SWill Pazner--- a/L/libCEED/build_tarballs.jl
77ead10094SWill Pazner+++ b/L/libCEED/build_tarballs.jl
78ead10094SWill Pazner@@ -3,11 +3,11 @@
79ead10094SWill Pazner using BinaryBuilder, Pkg
80ead10094SWill Pazner
81ead10094SWill Pazner name = "libCEED"
82ead10094SWill Pazner-version = v"0.7.0"
83ead10094SWill Pazner+version = v"0.8.0"
84ead10094SWill Pazner
85ead10094SWill Pazner # Collection of sources required to complete build
86ead10094SWill Pazner sources = [
87ead10094SWill Pazner-    GitSource("https://github.com/CEED/libCEED.git", "06988bf74cc6ac18eacafe7930f080803395ba29")
88ead10094SWill Pazner+    GitSource("https://github.com/CEED/libCEED.git", "e8f234590eddcce2220edb1d6e979af7a3c35f82")
89ead10094SWill Pazner ]
90ead10094SWill Pazner```
9117be3a41SJeremy L ThompsonAfter the PR is merged into Yggdrasil, the new version of libCEED_jll will automatically be registered, and then we can proceed to update LibCEED.jl.
92ead10094SWill Pazner
93ead10094SWill Pazner### Updating LibCEED.jl
94ead10094SWill Pazner
9517be3a41SJeremy L ThompsonAfter the binary wrapper package libCEED_jll has been updated, we are ready to update the main Julia interface LibCEED.jl.
9617be3a41SJeremy L ThompsonThis requires updating the file `julia/LibCEED.jl/Project.toml` in the libCEED repository.
9717be3a41SJeremy L ThompsonThe version number should be incremented, and the dependency on the updated version of libCEED_jll should be listed:
98ead10094SWill Pazner```diff
99ead10094SWill Paznerdiff --git a/julia/LibCEED.jl/Project.toml b/julia/LibCEED.jl/Project.toml
100ead10094SWill Pazner--- a/julia/LibCEED.jl/Project.toml
101ead10094SWill Pazner+++ b/julia/LibCEED.jl/Project.toml
102ead10094SWill Pazner@@ -1,7 +1,7 @@
103ead10094SWill Pazner name = "LibCEED"
104ead10094SWill Pazner uuid = "2cd74e05-b976-4426-91fa-5f1011f8952b"
105ead10094SWill Pazner-version = "0.1.0"
106ead10094SWill Pazner+version = "0.1.1"
107ead10094SWill Pazner
108ead10094SWill Pazner [deps]
109ead10094SWill Pazner CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
110ead10094SWill Pazner@@ -26,4 +26,4 @@ Cassette = "0.3"
111ead10094SWill Pazner Requires = "1"
112ead10094SWill Pazner StaticArrays = "0.12"
113ead10094SWill Pazner UnsafeArrays = "1"
114ead10094SWill Pazner-libCEED_jll = "0.7"
115ead10094SWill Pazner+libCEED_jll = "0.8"
116ead10094SWill Pazner```
11717be3a41SJeremy L ThompsonOnce this change is merged into libCEED's `main` branch, the updated package version can be registered using the GitHub registrator bot by commenting on the commit:
118ead10094SWill Pazner
119446df8bcSWill Pazner> @JuliaRegistrator register branch=main subdir=julia/LibCEED.jl
120ead10094SWill Pazner
12117be3a41SJeremy L ThompsonAt this point, the bot should create a PR against the [general Julia registry](https://github.com/JuliaRegistries/General), which should be merged automatically after a short delay.
1222475aa4cSWill Pazner
1232475aa4cSWill Pazner### Moving development tests to release tests
1242475aa4cSWill Pazner
12517be3a41SJeremy L ThompsonLibCEED.jl has both _development_ and _release_ unit tests.
12617be3a41SJeremy L ThompsonThe _release_ tests are run both with the current build of libCEED, and with the most recent release of libCEED_jll.
12717be3a41SJeremy L ThompsonThe _development_ tests may use features which were not available in the most recent release, and so they are only run with the current build of libCEED.
1282475aa4cSWill Pazner
12917be3a41SJeremy L ThompsonUpon release, the development tests may be moved to the release tests, so that these features will be tested against the most recent release of libCEED_jll.
13017be3a41SJeremy L ThompsonThe release tests are found in the file `julia/LibCEED.jl/test/runtests.jl` and the development tests are found in `julia/LibCEED.jl/test/rundevtests.jl`.
131ff0d35f1Sjeremylt
132ff0d35f1Sjeremylt## Python
133ff0d35f1Sjeremylt
1342aa7bb50SJed BrownThe Python package gets its version from `ceed.pc.template` so there are no file modifications necessary.
1352aa7bb50SJed Brown
1360f9ce5c8SJed Brown1. CI builds and tests wheels when a pull request has the `release preparation` label. One can also use `cibuildwheel --only cp310-manylinux_x86_64` to build and test wheels locally (inside a container).
137dd8ab4d9SJed Brown2. CI publishes wheels on `v**` tags, assuming tests pass.
138dd8ab4d9SJed Brown
139dd8ab4d9SJed Brown### Reminder about manual publishing (not needed with CI)
140dd8ab4d9SJed Brown
141dd8ab4d9SJed Brown1. Create a `~/.pypirc` with entries for `testpypi` (`https://test.pypi.org/legacy/`) and the real `pypi`.
142dd8ab4d9SJed Brown2. Upload to `testpypi` using
1432aa7bb50SJed Brown```console
1442aa7bb50SJed Brown$ twine upload --repository testpypi wheelhouse/libceed-0.8-cp39-cp39-manylinux2010_x86_64.whl
1452aa7bb50SJed Brown```
146dd8ab4d9SJed Brown3. Test installing on another machine/in a virtualenv:
1472aa7bb50SJed Brown```console
1482aa7bb50SJed Brown$ pip install --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple libceed
1492aa7bb50SJed Brown```
1502aa7bb50SJed BrownThe `--extra-index-url` argument allows dependencies like `cffi` and `numpy` from being fetched from the non-test repository.
151dd8ab4d9SJed Brown4. Do it live:
1522aa7bb50SJed Brown```console
1532aa7bb50SJed Brown$ twine upload --repository pypi wheelhouse/libceed-0.8-cp39-cp39-manylinux2010_x86_64.whl
1542aa7bb50SJed Brown```
1552aa7bb50SJed BrownNote that this cannot be amended.
156ff0d35f1Sjeremylt
157ff0d35f1Sjeremylt## Rust
158ff0d35f1Sjeremylt
1592aa7bb50SJed BrownThe Rust crates for libCEED are split into
1602aa7bb50SJed 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)
1612aa7bb50SJed Brown2. [`libceed`](https://crates.io/crates/libceed) containing the safe and idiomatic Rust bindings.
1622aa7bb50SJed Brown
16317be3a41SJeremy L ThompsonWe currently apply the same version number across both of these crates.
164*30b49de6SJed BrownVersion numbers are automatically updated using the following, which creates a new commit with the version updates. You can squash that commit into the commit with version updates for the rest of the package.
1652aa7bb50SJed Brown
1662aa7bb50SJed Brown```console
167*30b49de6SJed Brown$ cargo release --no-tag --no-push --no-publish 0.12.0 --execute
1682aa7bb50SJed Brown```
1692aa7bb50SJed Brown
1702aa7bb50SJed BrownAfter doing this,
1712aa7bb50SJed Brown
1728ec64e9aSJed Brown1. `cargo package --list --package libceed-sys` and `--package libceed` to see that the file list makes sense.
1738ec64e9aSJed Brown2. `cargo release` to build crates locally (handling dependencies between creates in the workspace)
1748ec64e9aSJed Brown3. `cargo release publish --execute` to publish the crates to https://crates.io
175