Skip to content

Release steps

Albert Y. Kim edited this page Aug 24, 2019 · 1 revision

Copied from corresponding Google Doc (only the first part):

1. Final cosmetic edits and checks:

a) Formatting

  • Borders of all histograms should be white, making the binning structure easier to read.
  • Use computer font for all computing concepts: function(), data_frame, variable_names, package_name.
  • Maybe? Consider using bold only for statistical concepts?
  • Remove all &, %, and _ in fig.cap for R chunk options since they break PDF build
  • Ensure no code exceeds 80 characters. While HTML code block outputs tolerate >80, PDF code block outputs do not.
  • Ensure skimr::skim() code is not actually run, but all calls and outputs are hard-coded (with hist preview removed and --- output cut down to 80 characters), since this will break all knitr::kable() code for rest of book.

b) References

  • Search for all broken references (search for @ref and ?? in html output)
  • Maintain Chapter/Section/Subsection naming consistency
  • As much as feasible, ensure index is up-to-date by adding \index{<term>} tags
  • Ensure all Figures & Tables are referenced.

c) Dataset management

  • Remove all load() calls if possible
  • Ensure all CSV’s are loaded from moderndive.com and not other sites (our personal sites for example). See index.Rmd, set-options R chunk, copy all needed csv files to docs/
  • Create bit.ly links for all linked Google Docs

d) Spell check

  • Do it in RStudio.
  • Scan over all changed content to make sure grammar is correct.

e) R Scripts: Make sure docs/scripts folder contains the appropriate scripts

  • Can be built using source(“purl.R”)
  • If time allows, go over all code blocks and ensure that purl = FALSE is set for all code chunks we don't want shared.
  • Requires the book published to moderndive.com to have links to moderndive.com/scripts
  • Development version should link to moderndive.netlify.com/scripts since code may be updated in development causing problems if someone on moderndive.com is trying to look over all the code for what is there

f) ETC

  • Ensure only Shutterstock licensed photos/images are used.
  • Delete contents of rds/ and rebuild all .rds files in case any got stale.

g) Final steps

  • Update all R packages before one final build
  • Change .travis.yml so that infer and moderndive packages are NOT GitHub development .9000 versions but rather CRAN versions.
  • Relatedly, ensure moderndive package on CRAN is updated around same time as moderndive book version bump.
  • Build PDF version

2. Switch from dev to release version on GitHub:

a) Create new GitHub branch

Create dev-to-release-vX.X.X branch to be used for pull request. See example commit on GitHub.

b) Edit index.Rmd

At the top

  • YAML: Change r format(Sys.time(), '%B %d, %Y') to release date of form “January 1, 1970”
  • Remove “development branch” version warning block

set-options R chunk

  • Current version information:
    • Remove .9000 and bump version number
    • Set date to release date: replace format(Sys.time(), '%B %d, %Y') with date of form “January 1, 1970”
  • Latest release information:
    • Update to release values
  • CRAN packages needed:
    • If possible, use CRAN versions
    • Periodically: Do a search for use of all packages and remove those no longer used
  • GitHub packages needed:
    • Ensure they are installed from master branch. For ex, don’t do: devtools::install_github("moderndive/moderndive", ref = "version_bump")
    • Jump to .travis.yml -> r_github_packages -> remove @commit_number. For ex, don’t do: andrewpbray/infer@83451d0caaa54eeb7f582d5889a6ec1597cd805e

Section 1.4 “About this book”

  • Latest published version: ensure info is correct
  • Previous versions: Add previous version info
  • Add previous version to previous_version/ folder. Steps:
    • Go to previous_versions/ and add new subfolder for soon-to-be previous version
    • Go to GitHub releases pages and download .zip of source code of soon-to-be previous version
    • In index.Rmd
      • Uncomment notice about this being an out-of-date version
      • Ensure comment is surrounded by *** to highlight this note
    • Build book
    • Copy contents of docs/ folder to the new subfolder in previous_version/

c) Edit other files:

  • All Chapter .Rmd files: Remove all install_github() package installations
  • NEWS.md: Update with all significant changes from this TODO
  • .gitignore: Remove bib/packages.bib

3. Publish release

  • Merge dev-to-release-vX.X.X branch into master
  • Merge master into release via PR (trick to remember: right into left). Or consider doing this?
  • Rebuild release/docs and commit. You might need to remove docs/ from .gitignore to be able to commit to release branch
  • Tag release on GitHub

4. Revert back to dev version on GitHub:

a) Create new GitHub branch

Create release-to-dev branch to be used for pull request. See example commit on GitHub to revert back to devel version by undoing all changes to:

b) Edit index.Rmd

At the top

  • YAML: Change release date back to r format(Sys.time(), '%B %d, %Y')
  • Return “development branch” version warning block

set-options R chunk

  • Current version information:
    • Add .9000 to version number
    • Set date to r format(Sys.time(), '%B %d, %Y')

c) Edit other files:

  • NEWS.md: Add section for new dev version
  • Add bib/packages.bib to .gitignore
  • Revert .travis.yml so that infer and moderndive packages are github dev versions