Skip to content
Brewster Malevich edited this page Mar 2, 2022 · 5 revisions

How to release to CRAN

You've decided to release a new version of burnr. You've picked the next version number (following semantic versioning, see https://r-pkgs.org/release.html#release-version) and you're ready to begin.

This is intended as a supplement to the general guidelines here: https://r-pkgs.org/release.html. If you haven't already, read that first.

Here is the process in concrete steps. Expect this process to take longer than 30 minutes.

1. Double check that NEWS.md, and README.md/README.Rmd are up to date with the latest improvements on master.

Carefully read through README.md/README.rmd and NEWS.md. Be sure you're reading the latest versions on the master branch.

Remember that change noted in NEWS.md should cite a relevant pull request (PR) or issue number, and call out people who helped with the fix. Prefer callouts and thanks using a link with a github name (e.g. @brews), otherwise use the individual's name. See https://r-pkgs.org/release.html#news for additional guidelines.

2. Double check recent runs of CI/CD tests.

Go to https://github.com/ltrr-arizona-edu/burnr/actions and examine the latest CI/CD runs.

Ensure CI/CD tests and checks ran and passed for the last commit. Also ensure that the last CI/CD run was within the last week at most. Manually trigger CI/CD tests and checks on github if they haven't been run recently.

Be sure to look through the CI/CD logs in the "Check" step of the R-CMD-check workflow. Don't just look for the green checkmark before submitting a release release.

All ERRORs or WARNINGs in the checks must be resolved. Resolve as many NOTEs as possible. See https://r-pkgs.org/release.html#release-check.

Any NOTEs that cannot be resolved must be documented in `cran-comments.md.

Check https://cran.r-project.org/web/checks/check_results_burnr.html. Resolve any status other than "OK".

File issues and submit fixes in PRs to fix any outstanding issues found.

3. Ensure we continue to follow CRAN policies

Double check the latest on CRAN policies here https://r-pkgs.org/release.html#cran-policies.

File issues and submit fixes through PRs to resolve any significant issues.

4. Prepare the actual release.

This assumes you're working from a direct clone of https://github.com/ltrr-arizona-edu/burnr and not a remote fork.

Create a new local branch to prepare for the next release. From a terminal, run

git checkout -b release_prep

Bump the versions in DESCRIPTION and NEWS.md file with the version being released. Remember to remove any development suffix. For example if v0.1.3.9000 is listed, remove the .9000.

git add NEWS.md
git add DESCRIPTION
git commit -m "Bump version in prep for release"

Now check your sanity. From R, run

devtools::check(cran=TRUE)

and ensure there are no ERRORs, WARNINGs, and you've tried to resolve as many NOTEs as possible. If there are ERRORs or WARNINGs, run git checkout master;git branch -D release_prep and return to step 2 above and attempt to resolve the issues from in the check.

Look through cran-comments.md. Be sure it is current. Remove any sections that are only relevant to past CRAN release submissions (a "Resubmission" section, for example). Ensure the "Test environments" correctly reflects the current testing environment (see CI/CD configuration). Again, be sure that any NOTEs from CI/CD tests and checks are noted here.

If any changes have been made to cran-comments.md, from a terminal, run

git add cran-comments.md
git commit -m "Update CRAN comments in prep for release"

5. Submit the package to CRAN for review.

From an R session, run

devtools::release()

and follow the prompts.

If the release was successfully submitted, check your email to immediately followup with submission confirmation from CRAN.

6. Submission accepted to CRAN.

Once CRAN confirms the package has been accepted via email, merge and push what work is done.

rm CRAN-RELEASE
git checkout master
git merge release_prep
git tag -a v{INSERT_RELEASE_HERE_X.Y.Z} -m 'v{INSERT_RELEASE_HERE_X.Y.Z}'
git push origin master
git push origin --tags

Prepare for the next release by adding .9000 suffix to the Version field in the DESCRIPTION and create a new heading in NEWS.md and commit the changes.

git add DESCRIPTION
git add NEWS.md
git commit -m 'Prepare for next release`
git push origin master

Now go to https://github.com/ltrr-arizona-edu/burnr/releases. Select the "Draft new release" button. Select the "tags" tab. Select the tag for the release just pushed to master (clicking on the ellipsis) and select "Create new release". Cut the heading for the release in NEWS.md and paste this into the 'Release title' section. Take the body of release changes in NEWS.md and paste this into the box to "Describe this release". Ensure everything is correctly formatted and then press the button to complete the Github release. Also check the box that "creates a new topic in Github Discussions" under announcement section.