diff --git a/.github/workflows/release-checklist.R b/.github/workflows/release-checklist.R new file mode 100644 index 0000000..ff2e0c4 --- /dev/null +++ b/.github/workflows/release-checklist.R @@ -0,0 +1,12 @@ +release_checklist <- function(version) { + # Platform checks + devtools::check_rhub(interactive = FALSE) + devtools::check_win_devel() + + # Reverse dependency checks + revdepcheck::revdep_reset() + revdepcheck::revdep_check() + + # Version number updates + desc::desc_set_version(version) +} diff --git a/.github/workflows/release-pr-body.md b/.github/workflows/release-pr-body.md new file mode 100644 index 0000000..cc65d5e --- /dev/null +++ b/.github/workflows/release-pr-body.md @@ -0,0 +1,23 @@ +`usmap v${{ inputs.version }}` release candidate + +#### Pre-release checklist: +- [ ] Review automated changes +- [ ] Review rhub and win_devel checks (see maintainer email for results) +- [ ] Review reverse dependency checks +- [ ] Review check and test results +- [ ] Verify `DESCRIPTION` and `NEWS.md` are accurate +- [ ] Update `cran-comments.md` if necessary +- [ ] Update `NEWS` if necessary +- [ ] Run `devtools::release()` from this branch +- [ ] Perform necessary CRAN verification release steps (see maintainer email) +Wait for CRAN to publish package. If issues are reported, make changes in this PR and re-run `devtools::release()`. + +#### Post-release checklist: +- [ ] `git tag v{{ $inputs.version }}` +- [ ] `git push --tags` +- [ ] Update `DESCRIPTION` and `NEWS.md` versions to `{{ $inputs.version }}.9000` +- [ ] Add release date of latest version to `NEWS.md` + - Example `Released Monday, February 31, 2020.` +- [ ] Commit changes with message `Prepare for next release` +- [ ] `usethis::use_github_release()` +- Merge this PR \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..d5e2d6f --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,58 @@ + +name: release + +on: + workflow_dispatch: + inputs: + version: + description: "The version number for new release, e.g. 1.0.2" + required: true + type: string + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup R + uses: r-lib/actions/setup-r@v2 + + - name: Install R dependencies + uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: | + any::desc + any::devtools + any::revdepcheck + + - name: Run release checks + env: + VERSION: ${{ inputs.version }} + run: | + source(".github/workflows/release-checklist.R") + release_checklist(Sys.getenv("VERSION")) + shell: Rscript {0} + + - name: Update NEWS.md version + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "[unreleased]" + replace: "usmap ${{ inputs.version }}" + include: "NEWS.md" + regex: false + + - name: Open pull request + id: open-pr + uses: peter-evans/create-pull-request@v5 + with: + commit-message: "[automated] Prepare for ${{ inputs.version }} release" + branch: release/${{ inputs.version }} + title: Release version ${{ inputs.version }} + body-path: .github/workflows/release-pr-body.md + reviewers: pdil + assignees: pdil + labels: release + delete-branch: true diff --git a/DESCRIPTION b/DESCRIPTION index 2f1e3de..217db38 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -26,6 +26,7 @@ Suggests: rmarkdown, scales, sf, + spelling, testthat (>= 3.0.0), vdiffr RoxygenNote: 7.3.1 diff --git a/R/data.R b/R/data.R index 3099afa..82b27b9 100644 --- a/R/data.R +++ b/R/data.R @@ -138,7 +138,7 @@ #' Earthquakes (2019) #' #' @description US earthquakes with a magnitude of 2.5 or greater, occurring in the -#' first half of 2019, from January 1st to June 30th, from USGS.\cr\cr +#' first half of 2019, from January 1 to June 30, from USGS.\cr\cr #' The data is formatted for transforming with [usmap::usmap_transform()]. #' Once the longitude and latitude is transformed, it can be added to #' [usmap::plot_usmap()] using [ggplot2::ggplot()] layers. diff --git a/R/usmap-package.R b/R/usmap-package.R index 6ed534d..7335896 100644 --- a/R/usmap-package.R +++ b/R/usmap-package.R @@ -25,7 +25,7 @@ #' pertaining to a FIPS code. #' #' Likewise a reverse lookup can be done where a FIPS code can be used to -#' retrieve the associated state(s) or county(ies). This can be useful when +#' retrieve the associated states or counties. This can be useful when #' preparing data to be merged with the map data frame. #' #' @section Plot US map data: diff --git a/inst/WORDLIST b/inst/WORDLIST new file mode 100644 index 0000000..37d568f --- /dev/null +++ b/inst/WORDLIST @@ -0,0 +1,29 @@ +Albers +Bartholemew +CRS +Cordova +DCW +Esri +Factbook +Geospatial +Grosvenor +Kusilvak +MULTILINESTRING +McNally +NGA +README +Rud +Rudis +USGS +Vectorization +Vectorize +choropleth +choropleths +codecov +expandability +fips +ggplot +ggthemes +github +usmapdata +️ diff --git a/man/earthquakes.Rd b/man/earthquakes.Rd index dfa73c1..7d8576d 100644 --- a/man/earthquakes.Rd +++ b/man/earthquakes.Rd @@ -12,7 +12,7 @@ data(earthquakes) } \description{ US earthquakes with a magnitude of 2.5 or greater, occurring in the -first half of 2019, from January 1st to June 30th, from USGS.\cr\cr +first half of 2019, from January 1 to June 30, from USGS.\cr\cr The data is formatted for transforming with \code{\link[=usmap_transform]{usmap_transform()}}. Once the longitude and latitude is transformed, it can be added to \code{\link[=plot_usmap]{plot_usmap()}} using \code{\link[ggplot2:ggplot]{ggplot2::ggplot()}} layers. diff --git a/man/usmap.Rd b/man/usmap.Rd index 0836e71..33e14e7 100644 --- a/man/usmap.Rd +++ b/man/usmap.Rd @@ -33,7 +33,7 @@ Several functions have been included to lookup the US state or county pertaining to a FIPS code. Likewise a reverse lookup can be done where a FIPS code can be used to -retrieve the associated state(s) or county(ies). This can be useful when +retrieve the associated states or counties. This can be useful when preparing data to be merged with the map data frame. } diff --git a/tests/spelling.R b/tests/spelling.R new file mode 100644 index 0000000..1d74607 --- /dev/null +++ b/tests/spelling.R @@ -0,0 +1,6 @@ +if (requireNamespace("spelling", quietly = TRUE)) + spelling::spell_check_test( + vignettes = TRUE, + error = FALSE, + skip_on_cran = TRUE + )