[x] Create branch labelled v[version]-rc, for example, v1.5.2-rc (the "rc" stands for "Release Candidate").
[x] Change the DESCRIPTION and NEWS on this branch to change the version number to the desired version for CRAN, e.g. from 1.5.1.9008 to 1.5.2.
[x] Commit and push to the RC branch.
[x] Clean your package directory to remove any extraneous files, including ones that are git-ignored. (Warning, this will delete any unsaved buffers in RStudio! Also, be sure to close RStudio before taking this step!) git clean -xdf .
NOTE: git clean -xdn . provides a "dry-run" list of what will be done / removed
[x] Build your package. I personally do it from the Mac command line like this:
PATH=$PATH:/Applications/RStudio.app/Contents/MacOS/pandoc R CMD build [pkgdir]
[x] Do a sanity check by installing/testing the built package.
[x] Run PATH=$PATH:/Applications/RStudio.app/Contents/MacOS/pandoc R CMD check --as-cran pkg_version.tar.gz both locally and on win-builder. You can also use https://r-hub.github.io/rhub/.
[x] I don't know how much it matters but I have this file as my ~/.R/Makevars:
[x] Read every bullet point in the CRAN Policies document if this is the first release of the package. I usually print it out and check off the items one by one.
[x] Submit to CRAN via their online form.
[x] If there are R CMD check warnings that are unavoidable, make sure to explain them in the comments.
[x] If rejected, make changes on the RC branch and bump the fourth (patch) version component, i.e. 1.5.2.1.
[x] When accepted, tag the RC branch with a v1.5.2.1 tag (or whatever version you finally ended up getting accepted), and push the tag to origin.
[x] Merge RC into master.
[x] On master, change the package version to 1.5.2.9000.
git clean -xdf .
git clean -xdn .
provides a "dry-run" list of what will be done / removedPATH=$PATH:/Applications/RStudio.app/Contents/MacOS/pandoc R CMD check --as-cran pkg_version.tar.gz
both locally and on win-builder. You can also use https://r-hub.github.io/rhub/.