Skip to content

Commit a53ad56

Browse files
authored
Merge pull request #275 from cmu-delphi/formatMergeback
pkgdown fixes, DEVELOPMENT release notes
2 parents 6b98373 + 1f4d894 commit a53ad56

File tree

3 files changed

+35
-24
lines changed

3 files changed

+35
-24
lines changed

.github/workflows/pkgdown.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ name: pkgdown
1616

1717
jobs:
1818
pkgdown:
19+
# only build docs on the main repository and not forks
1920
if: github.repository_owner == 'cmu-delphi'
2021
runs-on: ubuntu-latest
2122
# Only restrict concurrency for non-PR jobs
@@ -39,19 +40,21 @@ jobs:
3940
needs: website
4041

4142
- name: Build site
43+
# - target_ref gets the ref from a different variable, depending on the event
44+
# - override allows us to set the pkgdown mode and version_label
45+
# - mode: release is the standard build mode, devel places the site in /dev
46+
# - version_label: 'light' and 'success' are CSS labels for Bootswatch: Cosmo
47+
# https://bootswatch.com/cosmo/
48+
# - we use pkgdown:::build_github_pages to build the site because of an issue in pkgdown
49+
# https://github.com/r-lib/pkgdown/issues/2257
4250
run: |
43-
override <- if (startsWith("${{ github.event_name }}", "pull_request")) {
44-
if ("${{ github.base_ref }}" == "main") {
45-
list(development = list(mode = "release", version_label = "light"))
46-
} else {
47-
list(development = list(mode = "devel", version_label = "success"))
48-
}
51+
target_ref <- "${{ github.event_name == 'pull_request' && github.base_ref || github.ref }}"
52+
override <- if (target_ref == "main" || target_ref == "refs/heads/main") {
53+
list(development = list(mode = "release", version_label = "light"))
54+
} else if (target_ref == "dev" || target_ref == "refs/heads/dev") {
55+
list(development = list(mode = "devel", version_label = "success"))
4956
} else {
50-
if ("${{ github.ref_name }}" == "main") {
51-
list(development = list(mode = "release", version_label = "light"))
52-
} else {
53-
list(development = list(mode = "devel", version_label = "success"))
54-
}
57+
stop("Unexpected target_ref: ", target_ref)
5558
}
5659
pkg <- pkgdown::as_pkgdown(".", override = override)
5760
cli::cli_rule("Cleaning files from old site...")

DEVELOPMENT.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ Please follow the guidelines in the [PR template document](.github/pull_request_
4848

4949
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")`):
5050

51-
- [ ] `git pull`
52-
- [ ] Check [current CRAN check results](https://cran.rstudio.org/web/checks/check_results_epidatr.html)
51+
52+
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")`):
53+
54+
- [ ] `git pull` on `dev` branch.
55+
- [ ] Make sure all changes are committed and pushed.
56+
- [ ] Check [current CRAN check results](https://cran.rstudio.org/web/checks/check_results_epiprocess.html).
5357
- [ ] `devtools::check(".", manual = TRUE, env_vars = c(NOT_CRAN = "false"))`.
5458
- Aim for 10/10, no notes.
5559
- [ ] 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
6165
- This may choke on the MIT license url, and that's ok.
6266
- [ ] `devtools::build_readme()`
6367
- [ ] `devtools::check_win_devel()`
64-
- [ ] Check email for problems
68+
- [ ] Have maintainer ("cre" in description) check email for problems.
6569
- [ ] `revdepcheck::revdep_check(num_workers = 4)`.
6670
- 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.
6771
- [ ] Update `cran-comments.md`
68-
- [ ] PR with any changes
72+
- [ ] PR with any changes (and go through the list again) into `dev` and run through the list again.
6973

7074
Submit to CRAN:
7175

72-
- [ ] `devtools::submit_cran()`
73-
- [ ] Approve email
76+
- [ ] `devtools::submit_cran()`.
77+
- [ ] Maintainer approves email.
7478

7579
Wait for CRAN...
7680

77-
- [ ] Accepted :tada:
78-
- [ ] `dev`
79-
- [ ] `usethis::use_github_release(publish = FALSE)` (publish off, otherwise it won't push).
80-
- [ ] check the release notes and publish the branch on github
81+
- [ ] If accepted :tada:, move to next steps. If rejected, fix and resubmit.
82+
- [ ] Open and merge a PR containing any updates made to `main` back to `dev`.
83+
- [ ] `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.
84+
- [ ] Go to the repo, verify the release notes, and publish when ready.

_pkgdown.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# Colors should stay consistent across epipredict & epidatr, using Carnegie
2-
# Red https://www.cmu.edu/brand/brand-guidelines/visual-identity/colors.html
1+
# Colors should stay consistent across epipredict, epiprocess, and epidatr,
2+
# using Carnegie Red
3+
# https://www.cmu.edu/brand/brand-guidelines/visual-identity/colors.html
34

45
# This is to give a default value to the `mode` parameter in the
56
# `pkgdown::build_site` function. This is useful when building the site locally,
@@ -15,11 +16,14 @@ template:
1516
bslib:
1617
font_scale: 1.0
1718
primary: "#C41230"
19+
success: "#B4D43C"
1820
link-color: "#C41230"
1921

2022
navbar:
2123
bg: primary
22-
type: dark
24+
type: light
25+
26+
url: https://cmu-delphi.github.io/epidatr/
2327

2428
home:
2529
links:

0 commit comments

Comments
 (0)