Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pkgdown actions based on branch reorganization #383

Merged
merged 6 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# Created with usethis + edited to run on PRs to dev, use API key.
on:
push:
branches: [main, master]
branches: [main, dev]
pull_request:
branches: [main, master, dev]
branches: [main, dev]

name: R-CMD-check

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# Created with usethis + edited to run on PRs to dev, use API key.
on:
push:
branches: [main, master]
branches: [main, dev]
pull_request:
branches: [main, master, dev]
branches: [main, dev]
release:
types: [published]
workflow_dispatch:
Expand Down
59 changes: 59 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
## Setting up the development environment

```r
install.packages(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
```

## Validating the package

```r
styler::style_pkg() # format code
lintr::lint_package() # lint code

devtools::test() # test package
devtools::check() # check package for errors
```

## Developing the documentation site

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.

The documentation site can be previewed locally by running in R

```r
pkgdown::build_site(preview=TRUE)
```

The `main` version is available at `file:///<local path>/epidatr/docs/index.html` and `dev` at `file:///<local path>/epidatr/docs/dev/index.html`.

You can also build the docs manually and launch the site with python. From the terminal, this looks like
```bash
R -e 'devtools::document()'
python -m http.server -d docs
```

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`.

The documentation website is updated on push or pull request to the `main` and `dev` branches.

## Release process

### Manual

TBD

### Automated (currently unavailable)

The release consists of multiple steps which can be all done via the GitHub website:

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.
2. The action will prepare a new release and will end up with a new [Pull Request](https://github.com/cmu-delphi/epidatr/pulls)
3. Let the code owner review the PR and its changes and let the CI check whether everything builds successfully
4. Once approved and merged, another GitHub action job starts which automatically will
1. create a git tag
2. create another [Pull Request](https://github.com/cmu-delphi/epidatr/pulls) to merge the changes back to the `dev` branch
3. create a [GitHub release](https://github.com/cmu-delphi/epidatr/releases) with automatically derived release notes
5. Release to CRAN
3 changes: 1 addition & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# epiprocess 0.7.0.9999
# epiprocess 0.7.0.9000

## Improvements

Expand Down
152 changes: 78 additions & 74 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,86 +1,90 @@
template:
bootstrap: 5
bootswatch: cosmo
bslib:
font_scale: 1.0
primary: '#C41230'
link-color: '#C41230'
navbar-bg: '#C41230'
navbar-fg: '#f8f8f8'
bootstrap: 5

development:
mode: auto

# Colors from epipredict & epidatr, including Carnegie Red https://www.cmu.edu/brand/brand-guidelines/visual-identity/colors.html
navbar:
bg: '#C41230'
fg: '#f8f8f8'

bg: "#C41230"
fg: "#f8f8f8"
bootswatch: cosmo
bslib:
font_scale: 1.0
primary: "#C41230"
link-color: "#C41230"
navbar-bg: "#C41230"
navbar-fg: "#f8f8f8"

url: https://cmu-delphi.github.io/epiprocess/

home:
links:
- text: Introduction to Delphi's Tooling Work
href: https://cmu-delphi.github.io/delphi-tooling-book/
- text: Get the epipredict R package
href: https://cmu-delphi.github.io/epipredict/
- text: Get the epidatr R package
href: https://github.com/cmu-delphi/epidatr
links:
- text: Introduction to Delphi's Tooling Work
href: https://cmu-delphi.github.io/delphi-tooling-book/
- text: Get the epipredict R package
href: https://cmu-delphi.github.io/epipredict/
- text: Get the epidatr R package
href: https://github.com/cmu-delphi/epidatr
- text: Get the epidatasets R package
href: https://cmu-delphi.github.io/epidatasets/

articles:
- title: Using the package
desc: Basic usage and examples.
navbar: ~
contents:
- epiprocess
- slide
- growth_rate
- correlation
- aggregation
- outliers
- archive
- advanced
- compactify
- title: Using the package
desc: Basic usage and examples.
navbar: ~
contents:
- epiprocess
- slide
- growth_rate
- correlation
- aggregation
- outliers
- archive
- advanced
- compactify

repo:
url:
home: https://github.com/cmu-delphi/epiprocess/tree/main/
source: https://github.com/cmu-delphi/epiprocess/blob/main/
issue: https://github.com/cmu-delphi/epiprocess/issues
user: https://github.com/

url:
home: https://github.com/cmu-delphi/epiprocess/tree/main/
source: https://github.com/cmu-delphi/epiprocess/blob/main/
issue: https://github.com/cmu-delphi/epiprocess/issues
user: https://github.com/

reference:
- title: "`epi_df` basics"
desc: Details on `epi_df` format, and basic functionality.
- contents:
- matches("epi_df")
- title: "`epi_*()` functions"
desc: Functions that act on `epi_df` objects.
- contents:
- epi_slide
- epi_cor
- title: Vector functions
desc: Functions that act directly on signal variables.
- contents:
- growth_rate
- detect_outlr
- detect_outlr_rm
- detect_outlr_stl
- title: "`epi_archive` basics"
desc: Details on `epi_archive`, and basic functionality.
- contents:
- matches("archive")
- title: "`epix_*()` functions"
desc: Functions that act on an `epi_archive` and/or `grouped_epi_archive` object.
- contents:
- starts_with("epix")
- group_by.epi_archive
- title: Example data
- contents:
- archive_cases_dv_subset
- incidence_num_outlier_example
- contains("jhu_csse")
- title: internal
contents:
- epiprocess
- max_version_with_row_in
- next_after
- guess_period

- title: "`epi_df` basics"
desc: Details on `epi_df` format, and basic functionality.
- contents:
- matches("epi_df")
- title: "`epi_*()` functions"
desc: Functions that act on `epi_df` objects.
- contents:
- epi_slide
- epi_cor
- title: Vector functions
desc: Functions that act directly on signal variables.
- contents:
- growth_rate
- detect_outlr
- detect_outlr_rm
- detect_outlr_stl
- title: "`epi_archive` basics"
desc: Details on `epi_archive`, and basic functionality.
- contents:
- matches("archive")
- title: "`epix_*()` functions"
desc: Functions that act on an `epi_archive` and/or `grouped_epi_archive` object.
- contents:
- starts_with("epix")
- group_by.epi_archive
- title: Example data
- contents:
- archive_cases_dv_subset
- incidence_num_outlier_example
- contains("jhu_csse")
- title: internal
contents:
- epiprocess
- max_version_with_row_in
- next_after
- guess_period
Loading