From f9f914c7f61a7d2dac0d140c535e86b457702e8e Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Sat, 3 Sep 2022 21:21:10 +0200 Subject: [PATCH 1/6] add CITATION.cff --- .Rbuildignore | 1 + CITATION.cff | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 CITATION.cff diff --git a/.Rbuildignore b/.Rbuildignore index c00b5b8..e3a78ec 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -18,3 +18,4 @@ datamanagement.R ^revdep$ ^CRAN-RELEASE$ ^data-raw$ +^CITATION\.cff$ diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..41ff858 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,45 @@ +# ----------------------------------------------------------- +# CITATION file created with {cffr} R package, v0.2.3.9000 +# See also: https://docs.ropensci.org/cffr/ +# ----------------------------------------------------------- + +cff-version: 1.2.0 +message: 'To cite package "opencage" in publications use:' +type: software +license: GPL-2.0-or-later +title: 'opencage: Geocode with the OpenCage API' +version: 0.2.2.9000 +abstract: Geocode with the OpenCage API, either from place name to longitude and latitude + (forward geocoding) or from longitude and latitude to the name and address of a + location (reverse geocoding), see . +authors: +- family-names: Possenriede + given-names: Daniel + email: possenriede+r@gmail.com + orcid: https://orcid.org/0000-0002-6738-9845 +- family-names: Sadler + given-names: Jesse + orcid: https://orcid.org/0000-0001-6081-9681 +- family-names: Salmon + given-names: Maƫlle + orcid: https://orcid.org/0000-0002-2815-0399 +repository: https://CRAN.R-project.org/package=opencage +repository-code: https://github.com/ropensci/opencage +url: https://docs.ropensci.org/opencage/ +contact: +- family-names: Possenriede + given-names: Daniel + email: possenriede+r@gmail.com + orcid: https://orcid.org/0000-0002-6738-9845 +keywords: +- geocode +- geocoder +- opencage +- opencage-api +- opencage-geocoder +- peer-reviewed +- placenames +- r +- r-package +- rspatial +- rstats From cb1fd5613b88b8813e4e59cb3bb64d9507ee53b9 Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Sat, 3 Sep 2022 21:21:54 +0200 Subject: [PATCH 2/6] add CITATION.cff GHA --- .github/workflows/update-citation-cff.yaml | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/update-citation-cff.yaml diff --git a/.github/workflows/update-citation-cff.yaml b/.github/workflows/update-citation-cff.yaml new file mode 100644 index 0000000..75cc124 --- /dev/null +++ b/.github/workflows/update-citation-cff.yaml @@ -0,0 +1,49 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# The action runs when: +# - A new release is published +# - The DESCRIPTION or inst/CITATION are modified +# - Can be run manually +# For customizing the triggers, visit https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +on: + release: + types: [published] + push: + branches: main + paths: + - DESCRIPTION + - inst/CITATION + workflow_dispatch: + +name: Update CITATION.cff + +jobs: + update-citation-cff: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + - uses: r-lib/actions/setup-r@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: | + any::cffr + any::V8 + + - name: Update CITATION.cff + run: | + + library(cffr) + + # Create your CITATION.cff file + cff_write(dependencies = FALSE) + + shell: Rscript {0} + + - name: Commit results + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add CITATION.cff + git commit -m 'Update CITATION.cff' || echo "No changes to commit" + git push origin || echo "No changes to commit" From 8be435f8975deb6edf6157651fbe945c3720d1f2 Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Sat, 24 Sep 2022 12:34:22 +0200 Subject: [PATCH 3/6] update CITATION.cff --- CITATION.cff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CITATION.cff b/CITATION.cff index 41ff858..d7f3a1d 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,5 +1,5 @@ # ----------------------------------------------------------- -# CITATION file created with {cffr} R package, v0.2.3.9000 +# CITATION file created with {cffr} R package, v0.3.0 # See also: https://docs.ropensci.org/cffr/ # ----------------------------------------------------------- From bd6081b1cc0f3327c2c4490cda5677bf73877a10 Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Sat, 24 Sep 2022 14:10:30 +0200 Subject: [PATCH 4/6] add package version to review comment --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index cf05e18..a997134 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -12,7 +12,7 @@ Authors@R: c( person("Noam", "Ross", role = "ctb"), person("Jake", "Russ", role = "ctb"), person("Julia", "Silge", role = "rev", - comment = "Julia Silge reviewed the package for rOpenSci, see .") + comment = "Julia Silge reviewed {opencage} (v. 0.1.0) for rOpenSci, see .") ) Description: Geocode with the OpenCage API, either from place name to longitude and latitude (forward geocoding) or from longitude and From f12aa212d19aa8533c3f5f3d51cedc99bad9c649 Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Sat, 24 Sep 2022 14:16:12 +0200 Subject: [PATCH 5/6] lint a little --- R/deprecated.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/R/deprecated.R b/R/deprecated.R index af670ae..d4cb6af 100644 --- a/R/deprecated.R +++ b/R/deprecated.R @@ -177,8 +177,7 @@ opencage_format <- function(lst) { if ("request" %in% names(lst)) { results$query <- as.character(lst$request$query) } - } - else { + } else { results <- NULL } From 42c3c8e30acfc5f24713c06d3338200aec055c86 Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Sat, 24 Sep 2022 14:45:10 +0200 Subject: [PATCH 6/6] add NEWS item --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index e202d87..44bc987 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,6 +12,7 @@ * GitHub actions workflows updated ([#142](https://github.com/ropensci/opencage/issues/142)). * Use [{lintr} version 3.0](https://www.tidyverse.org/blog/2022/07/lintr-3-0-0/) and add "package development" linters ([#144](https://github.com/ropensci/opencage/pull/144)). * `countrycodes` source and script were moved to `data-raw` ([#146](https://github.com/ropensci/opencage/pull/146)). +* Add CITATION.cff and a corresponding GitHub action ([#148](https://github.com/ropensci/opencage/pull/148)). # opencage 0.2.2