|
| 1 | +## Setting up the development environment |
| 2 | + |
| 3 | +```r |
| 4 | +install.packages(c('devtools', 'pkgdown', 'styler', 'lintr')) # install dev dependencies |
| 5 | +devtools::install_deps(dependencies = TRUE) # install package dependencies |
| 6 | +devtools::document() # generate package meta data and man files |
| 7 | +devtools::build() # build package |
| 8 | +``` |
| 9 | + |
| 10 | +## Validating the package |
| 11 | + |
| 12 | +```r |
| 13 | +styler::style_pkg() # format code |
| 14 | +lintr::lint_package() # lint code |
| 15 | + |
| 16 | +devtools::test() # test package |
| 17 | +devtools::check() # check package for errors |
| 18 | +``` |
| 19 | + |
| 20 | +## Developing the documentation site |
| 21 | + |
| 22 | +The [documentation site](https://cmu-delphi.github.io/epidatr/) is built off of the `main` branch. The `dev` version of the site is available at https://cmu-delphi.github.io/epidatr/dev. |
| 23 | + |
| 24 | +The documentation site can be previewed locally by running in R |
| 25 | + |
| 26 | +```r |
| 27 | +pkgdown::build_site(preview=TRUE) |
| 28 | +``` |
| 29 | + |
| 30 | +The `main` version is available at `file:///<local path>/epidatr/docs/index.html` and `dev` at `file:///<local path>/epidatr/docs/dev/index.html`. |
| 31 | + |
| 32 | +You can also build the docs manually and launch the site with python. From the terminal, this looks like |
| 33 | +```bash |
| 34 | +R -e 'devtools::document()' |
| 35 | +python -m http.server -d docs |
| 36 | +``` |
| 37 | + |
| 38 | +For `pkgdown` to correctly generate both public (`main`) and `dev` documentation sites, the package version in `DESCRIPTION` on `dev` must have four components, and be of the format `x.x.x.9000`. The package version on `main` must be in the format `x.x.x`. |
| 39 | + |
| 40 | +The documentation website is updated on push or pull request to the `main` and `dev` branches. |
| 41 | + |
| 42 | +## Release process |
| 43 | + |
| 44 | +### Manual |
| 45 | + |
| 46 | +TBD |
| 47 | + |
| 48 | +### Automated (currently unavailable) |
| 49 | + |
| 50 | +The release consists of multiple steps which can be all done via the GitHub website: |
| 51 | + |
| 52 | +1. Go to [create_release GitHub Action](https://github.com/cmu-delphi/epidatr/actions/workflows/create_release.yml) and click the `Run workflow` button. Enter the next version number or one of the magic keywords (patch, minor, major) and hit the green `Run workflow` button. |
| 53 | +2. The action will prepare a new release and will end up with a new [Pull Request](https://github.com/cmu-delphi/epidatr/pulls) |
| 54 | +3. Let the code owner review the PR and its changes and let the CI check whether everything builds successfully |
| 55 | +4. Once approved and merged, another GitHub action job starts which automatically will |
| 56 | + 1. create a git tag |
| 57 | + 2. create another [Pull Request](https://github.com/cmu-delphi/epidatr/pulls) to merge the changes back to the `dev` branch |
| 58 | + 3. create a [GitHub release](https://github.com/cmu-delphi/epidatr/releases) with automatically derived release notes |
| 59 | +5. Release to CRAN |
0 commit comments