1ead10094SWill Pazner# Release Procedures 2ead10094SWill Pazner 32aa7bb50SJed Brown*These notes are meant for a maintainer to create official releases.* 4ff0d35f1Sjeremylt 52aa7bb50SJed 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.) 62aa7bb50SJed Brown 72aa7bb50SJed Brown## Core C library 82aa7bb50SJed Brown 92aa7bb50SJed 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` 16*77ac943eSJeremy L Thompson* `CITATION.cff` 17ff0d35f1Sjeremylt 182aa7bb50SJed Brownas well as `include/ceed/ceed.h` (`CEED_VERSION_MAJOR`, `CEED_VERSION_MINOR`). 192aa7bb50SJed Brown 202aa7bb50SJed 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. 212aa7bb50SJed Brown 222aa7bb50SJed 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. 232aa7bb50SJed Brown 242aa7bb50SJed Brown### Quality control and good citizenry 252aa7bb50SJed Brown 262aa7bb50SJed 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). 272aa7bb50SJed Brown 282aa7bb50SJed 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. 292aa7bb50SJed Brown 302aa7bb50SJed Brown3. Update and test all the language bindings (see below) within the branch. 312aa7bb50SJed Brown 322aa7bb50SJed 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. 332aa7bb50SJed Brown 342aa7bb50SJed Brown### Tagging and releasing on GitHub 352aa7bb50SJed Brown 362aa7bb50SJed Brown0. Confirm all the steps above, including all language bindings. 372aa7bb50SJed Brown1. `git commit -am'libCEED 0.8.1'` 382aa7bb50SJed BrownMore frequently, this is amending the commit message on an in-progress commit, after rebasing if applicable on latest `main`. 392aa7bb50SJed Brown2. `git push` updates the PR holding release; opportunity for others to review 402aa7bb50SJed Brown3. `git switch main && git merge --ff-only HEAD@{1}` fast-forward merge into `main` 412aa7bb50SJed Brown4. `git tag --sign -m'libCEED 0.8.1'` 422aa7bb50SJed Brown5. `git push origin main v0.8.1` 432aa7bb50SJed Brown6. Draft a [new release on GitHub](https://github.com/CEED/libCEED/releases), using a few sentences gathered from the release notes. 442aa7bb50SJed Brown7. Submit a PR to Spack. 452aa7bb50SJed Brown8. Publish Julia, Python, and Rust packages. 462aa7bb50SJed Brown 472aa7bb50SJed Brown### Archive Users Manual on Zenodo 482aa7bb50SJed Brown 492aa7bb50SJed BrownGenerate the PDF using `make doc-latexpdf`, click "New version" on the [Zenodo 502aa7bb50SJed Brownrecord](https://zenodo.org/record/4302737) and upload. Update author info if applicable (new 512aa7bb50SJed Brownauthors, or existing authors changing institutions). Make a new PR to update the version 522aa7bb50SJed Brownnumber and DOI in `README.rst` and `doc/bib/references.bib`. 53ff0d35f1Sjeremylt 54ead10094SWill Pazner## Julia 55ead10094SWill Pazner 56ead10094SWill PaznerlibCEED's Julia interface (LibCEED.jl) has two components: 57ead10094SWill Pazner 58ead10094SWill Pazner* LibCEED.jl, the user-facing package that contains the Julia interface. 59ead10094SWill Pazner* libCEED_jll, a binary wrapper package ("jll package") that contains prebuilt binaries of the 60ead10094SWill Pazner libCEED library for various architectures. 61ead10094SWill Pazner 62ead10094SWill PaznerWhen there is a new release of libCEED, both of these components need to be updated. First, 63ead10094SWill PaznerlibCEED_jll is updated, and then LibCEED.jl. 64ead10094SWill Pazner 65ead10094SWill Pazner### Updating libCEED_jll 66ead10094SWill Pazner 67ead10094SWill PaznerThe binary wrapper package libCEED_jll is updated by making a pull request against 68ead10094SWill Pazner[Yggdrasil](https://github.com/JuliaPackaging/Yggdrasil), the Julia community build tree. In this 69ead10094SWill PaznerPR, the file `L/libCEED/build_tarballs.jl` should be changed to update version number and change the 70ead10094SWill Paznerhash of the libCEED commit to use to build the binaries, similar to the following diff: 71ead10094SWill Pazner```diff 72ead10094SWill Paznerdiff --git a/L/libCEED/build_tarballs.jl b/L/libCEED/build_tarballs.jl 73ead10094SWill Pazner--- a/L/libCEED/build_tarballs.jl 74ead10094SWill Pazner+++ b/L/libCEED/build_tarballs.jl 75ead10094SWill Pazner@@ -3,11 +3,11 @@ 76ead10094SWill Pazner using BinaryBuilder, Pkg 77ead10094SWill Pazner 78ead10094SWill Pazner name = "libCEED" 79ead10094SWill Pazner-version = v"0.7.0" 80ead10094SWill Pazner+version = v"0.8.0" 81ead10094SWill Pazner 82ead10094SWill Pazner # Collection of sources required to complete build 83ead10094SWill Pazner sources = [ 84ead10094SWill Pazner- GitSource("https://github.com/CEED/libCEED.git", "06988bf74cc6ac18eacafe7930f080803395ba29") 85ead10094SWill Pazner+ GitSource("https://github.com/CEED/libCEED.git", "e8f234590eddcce2220edb1d6e979af7a3c35f82") 86ead10094SWill Pazner ] 87ead10094SWill Pazner``` 88ead10094SWill PaznerAfter the PR is merged into Yggdrasil, the new version of libCEED_jll will automatically be 89ead10094SWill Paznerregistered, and then we can proceed to update LibCEED.jl. 90ead10094SWill Pazner 91ead10094SWill Pazner### Updating LibCEED.jl 92ead10094SWill Pazner 93ead10094SWill PaznerAfter the binary wrapper package libCEED_jll has been updated, we are ready to update the main Julia 94ead10094SWill Paznerinterface LibCEED.jl. This requires updating the file `julia/LibCEED.jl/Project.toml` in the libCEED 95ead10094SWill Paznerrepository. The version number should be incremented, and the dependency on the updated version of 96ead10094SWill PaznerlibCEED_jll should be listed: 97ead10094SWill Pazner```diff 98ead10094SWill Paznerdiff --git a/julia/LibCEED.jl/Project.toml b/julia/LibCEED.jl/Project.toml 99ead10094SWill Pazner--- a/julia/LibCEED.jl/Project.toml 100ead10094SWill Pazner+++ b/julia/LibCEED.jl/Project.toml 101ead10094SWill Pazner@@ -1,7 +1,7 @@ 102ead10094SWill Pazner name = "LibCEED" 103ead10094SWill Pazner uuid = "2cd74e05-b976-4426-91fa-5f1011f8952b" 104ead10094SWill Pazner-version = "0.1.0" 105ead10094SWill Pazner+version = "0.1.1" 106ead10094SWill Pazner 107ead10094SWill Pazner [deps] 108ead10094SWill Pazner CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" 109ead10094SWill Pazner@@ -26,4 +26,4 @@ Cassette = "0.3" 110ead10094SWill Pazner Requires = "1" 111ead10094SWill Pazner StaticArrays = "0.12" 112ead10094SWill Pazner UnsafeArrays = "1" 113ead10094SWill Pazner-libCEED_jll = "0.7" 114ead10094SWill Pazner+libCEED_jll = "0.8" 115ead10094SWill Pazner``` 116ead10094SWill PaznerOnce this change is merged into libCEED's `main` branch, the updated package version can be 117ead10094SWill Paznerregistered using the GitHub registrator bot by commenting on the commit: 118ead10094SWill Pazner 119446df8bcSWill Pazner> @JuliaRegistrator register branch=main subdir=julia/LibCEED.jl 120ead10094SWill Pazner 1212aa7bb50SJed BrownAt this point, the bot should create a PR against the [general Julia 122ead10094SWill Paznerregistry](https://github.com/JuliaRegistries/General), which should be merged automatically after a 123ead10094SWill Paznershort delay. 1242475aa4cSWill Pazner 1252475aa4cSWill Pazner### Moving development tests to release tests 1262475aa4cSWill Pazner 1272475aa4cSWill PaznerLibCEED.jl has both _development_ and _release_ unit tests. The _release_ tests are run both with 1282475aa4cSWill Paznerthe current build of libCEED, and with the most recent release of libCEED_jll. The _development_ 1292475aa4cSWill Paznertests may use features which were not available in the most recent release, and so they are only run 1302475aa4cSWill Paznerwith the current build of libCEED. 1312475aa4cSWill Pazner 1322475aa4cSWill PaznerUpon release, the development tests may be moved to the release tests, so that these features will 1332475aa4cSWill Paznerbe tested against the most recent release of libCEED_jll. The release tests are found in the file 1342475aa4cSWill Pazner`julia/LibCEED.jl/test/runtests.jl` and the development tests are found in 1352475aa4cSWill Pazner`julia/LibCEED.jl/test/rundevtests.jl`. 136ff0d35f1Sjeremylt 137ff0d35f1Sjeremylt## Python 138ff0d35f1Sjeremylt 1392aa7bb50SJed BrownThe Python package gets its version from `ceed.pc.template` so there are no file modifications necessary. 1402aa7bb50SJed Brown 1412aa7bb50SJed 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`. 1422aa7bb50SJed 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. 1432aa7bb50SJed Brown3. Create a `~/.pypirc` with entries for `testpypi` (`https://test.pypi.org/legacy/`) and the real `pypi`. 1442aa7bb50SJed Brown4. Upload to `testpypi` using 1452aa7bb50SJed Brown```console 1462aa7bb50SJed Brown$ twine upload --repository testpypi wheelhouse/libceed-0.8-cp39-cp39-manylinux2010_x86_64.whl 1472aa7bb50SJed Brown``` 1482aa7bb50SJed Brown5. Test installing on another machine/in a virtualenv: 1492aa7bb50SJed Brown```console 1502aa7bb50SJed Brown$ pip install --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple libceed 1512aa7bb50SJed Brown``` 1522aa7bb50SJed BrownThe `--extra-index-url` argument allows dependencies like `cffi` and `numpy` from being fetched from the non-test repository. 1532aa7bb50SJed Brown6. Do it live: 1542aa7bb50SJed Brown```console 1552aa7bb50SJed Brown$ twine upload --repository pypi wheelhouse/libceed-0.8-cp39-cp39-manylinux2010_x86_64.whl 1562aa7bb50SJed Brown``` 1572aa7bb50SJed BrownNote that this cannot be amended. 158ff0d35f1Sjeremylt 159ff0d35f1Sjeremylt## Rust 160ff0d35f1Sjeremylt 1612aa7bb50SJed BrownThe Rust crates for libCEED are split into 1622aa7bb50SJed 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) 1632aa7bb50SJed Brown2. [`libceed`](https://crates.io/crates/libceed) containing the safe and idiomatic Rust bindings. 1642aa7bb50SJed Brown 1652aa7bb50SJed 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. 1662aa7bb50SJed Brown 1672aa7bb50SJed Brown```console 1682aa7bb50SJed Brown$ git grep '0\.8' -- rust/ 1692aa7bb50SJed Brownrust/libceed-sys/Cargo.toml:version = "0.8.0" 1702aa7bb50SJed Brownrust/libceed-sys/README.md:libceed-sys = "0.8.0" 1712aa7bb50SJed Brownrust/libceed-sys/build.rs: .atleast_version("0.8") 1722aa7bb50SJed Brownrust/libceed/Cargo.toml:version = "0.8.0" 1732aa7bb50SJed Brownrust/libceed/Cargo.toml:libceed-sys = { version = "0.8", path = "../libceed-sys" } 1742aa7bb50SJed Brownrust/libceed/README.md:libceed = "0.8.0" 1752aa7bb50SJed Brown``` 1762aa7bb50SJed Brown 1772aa7bb50SJed BrownAfter doing this, 1782aa7bb50SJed Brown 1792aa7bb50SJed Brown1. `cargo package --list` to see that the file list makes sense. 1802aa7bb50SJed Brown2. `cargo package` to build crates locally 1812aa7bb50SJed Brown3. `cargo publish` to publish the crates to https://crates.io 182