From 1f4d8943dd0957e8990cee35f4ffff20be06a0e3 Mon Sep 17 00:00:00 2001 From: dsweber2 Date: Wed, 13 Mar 2024 16:32:17 -0700 Subject: [PATCH] pkgdown fixes, DEVELOPMENT release notes --- .github/workflows/pkgdown.yaml | 25 ++++++++++++++----------- DEVELOPMENT.md | 24 ++++++++++++++---------- _pkgdown.yml | 10 +++++++--- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index f7bf0f93..607c71b1 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -16,6 +16,7 @@ name: pkgdown jobs: pkgdown: + # only build docs on the main repository and not forks if: github.repository_owner == 'cmu-delphi' runs-on: ubuntu-latest # Only restrict concurrency for non-PR jobs @@ -39,19 +40,21 @@ jobs: needs: website - name: Build site + # - target_ref gets the ref from a different variable, depending on the event + # - override allows us to set the pkgdown mode and version_label + # - mode: release is the standard build mode, devel places the site in /dev + # - version_label: 'light' and 'success' are CSS labels for Bootswatch: Cosmo + # https://bootswatch.com/cosmo/ + # - we use pkgdown:::build_github_pages to build the site because of an issue in pkgdown + # https://github.com/r-lib/pkgdown/issues/2257 run: | - override <- if (startsWith("${{ github.event_name }}", "pull_request")) { - if ("${{ github.base_ref }}" == "main") { - list(development = list(mode = "release", version_label = "light")) - } else { - list(development = list(mode = "devel", version_label = "success")) - } + target_ref <- "${{ github.event_name == 'pull_request' && github.base_ref || github.ref }}" + override <- if (target_ref == "main" || target_ref == "refs/heads/main") { + list(development = list(mode = "release", version_label = "light")) + } else if (target_ref == "dev" || target_ref == "refs/heads/dev") { + list(development = list(mode = "devel", version_label = "success")) } else { - if ("${{ github.ref_name }}" == "main") { - list(development = list(mode = "release", version_label = "light")) - } else { - list(development = list(mode = "devel", version_label = "success")) - } + stop("Unexpected target_ref: ", target_ref) } pkg <- pkgdown::as_pkgdown(".", override = override) cli::cli_rule("Cleaning files from old site...") diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index cd7d75a3..46d52ad9 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -48,8 +48,12 @@ Please follow the guidelines in the [PR template document](.github/pull_request_ 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` -- [ ] Check [current CRAN check results](https://cran.rstudio.org/web/checks/check_results_epidatr.html) + +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` on `dev` branch. +- [ ] Make sure all changes are committed and pushed. +- [ ] Check [current CRAN check results](https://cran.rstudio.org/web/checks/check_results_epiprocess.html). - [ ] `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. @@ -61,20 +65,20 @@ Open a release issue and then copy and follow this checklist in the issue (modif - This may choke on the MIT license url, and that's ok. - [ ] `devtools::build_readme()` - [ ] `devtools::check_win_devel()` -- [ ] Check email for problems +- [ ] 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 +- [ ] PR with any changes (and go through the list again) into `dev` and run through the list again. Submit to CRAN: -- [ ] `devtools::submit_cran()` -- [ ] Approve email +- [ ] `devtools::submit_cran()`. +- [ ] Maintainer approves email. Wait for CRAN... -- [ ] Accepted :tada: -- [ ] `dev` -- [ ] `usethis::use_github_release(publish = FALSE)` (publish off, otherwise it won't push). -- [ ] check the release notes and publish the branch on github +- [ ] If accepted :tada:, move to next steps. If rejected, fix and resubmit. +- [ ] Open and merge a PR containing any updates made to `main` back to `dev`. +- [ ] `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. diff --git a/_pkgdown.yml b/_pkgdown.yml index 98124004..5bdc2d00 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,5 +1,6 @@ -# Colors should stay consistent across epipredict & epidatr, using Carnegie -# Red https://www.cmu.edu/brand/brand-guidelines/visual-identity/colors.html +# Colors should stay consistent across epipredict, epiprocess, and epidatr, +# using Carnegie Red +# https://www.cmu.edu/brand/brand-guidelines/visual-identity/colors.html # This is to give a default value to the `mode` parameter in the # `pkgdown::build_site` function. This is useful when building the site locally, @@ -15,11 +16,14 @@ template: bslib: font_scale: 1.0 primary: "#C41230" + success: "#B4D43C" link-color: "#C41230" navbar: bg: primary - type: dark + type: light + +url: https://cmu-delphi.github.io/epidatr/ home: links: