pak::pkg_install(c('devtools', 'pkgdown', 'styler', 'lintr')) # install dev dependencies
devtools::install_deps(dependencies = TRUE) # install package dependencies
devtools::document() # generate package meta data and man files
devtools::build() # build package
styler::style_pkg() # format code
lintr::lint_package() # lint code
devtools::test() # test package
devtools::check() # check package for errors
Our CI builds two version of the documentation:
- https://cmu-delphi.github.io/epidatr/ from the
main
branch and - https://cmu-delphi.github.io/epidatr/dev from the
dev
branch.
The documentation site can be previewed locally by running in R:
# Should automatically open a browser
pkgdown::build_site(preview=TRUE)
If the above does not open a browser, you can try using a Python server from the command line:
R -e 'devtools::document()'
R -e 'pkgdown::build_site()'
python -m http.server -d docs
Please follow the guidelines in the PR template document.
Open a release issue and then copy and follow this checklist in the issue (modified from the checklist generated by usethis::use_release_issue(version = "1.0.2")
):
Open a release issue and then copy and follow this checklist in the issue (modified from the checklist generated by usethis::use_release_issue(version = "1.0.2")
):
-
git pull
ondev
branch. - Make sure all changes are committed and pushed.
- Check current CRAN check results.
-
devtools::check(".", manual = TRUE, env_vars = c(NOT_CRAN = "false"))
.- Aim for 10/10, no notes.
- If check works well enough, merge to main. Otherwise open a PR to fix up.
- Polish NEWS.
- Some guidelines.
-
git checkout main
-
git pull
-
urlchecker::url_check()
.- This may choke on the MIT license url, and that's ok.
-
devtools::build_readme()
-
devtools::check_win_devel()
- Have maintainer ("cre" in description) check email for problems.
-
revdepcheck::revdep_check(num_workers = 4)
.- This may choke, it is very sensitive to the binary versions of packages on a given system. Either bypass or ask someone else to run it if you're concerned.
- Update
cran-comments.md
- PR with any changes (and go through the list again) into
dev
and run through the list again.
Submit to CRAN:
-
devtools::submit_cran()
. - Maintainer approves email.
Wait for CRAN...
- If accepted 🎉, move to next steps. If rejected, fix and resubmit.
- Open and merge a PR containing any updates made to
main
back todev
. -
usethis::use_github_release(publish = FALSE)
(publish off, otherwise it won't push) will create a draft release based on the commit hash in CRAN-SUBMISSION and push a tag to the GitHub repo. - Go to the repo, verify the release notes, and publish when ready.