Skip to content
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
20 changes: 0 additions & 20 deletions .github/workflows/check_on_branch.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/check_on_main.yml

This file was deleted.

116 changes: 10 additions & 106 deletions .github/workflows/check_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,119 +7,23 @@ name: checklist

jobs:
check-package:
name: check package

runs-on: ubuntu-24.04

permissions:
contents: read

name: check-package
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
_R_CHECK_SYSTEM_CLOCK_: false
RSPM: "https://packagemanager.rstudio.com/cran/__linux__/noble/latest"
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

RSPM: "https://packagemanager.posit.co/cran/__linux__/noble/latest"
permissions:
contents: read
steps:
- name: Check out code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
fetch-depth: 0

- name: Set up R
uses: r-lib/actions/setup-r@ff9d3a3fd8acec17e91f1d0a1876d95ad60cb519
with:
r-version: release
extra-repositories:
https://cranhaven.r-universe.dev
https://inbo.r-universe.dev

- name: Set up Pandoc
uses: r-lib/actions/setup-pandoc@f50f115c574d8cb2ddc24934af6bed478382b0e7

- name: Set up R dependencies
uses: r-lib/actions/setup-r-dependencies@2e3959d284a9ed60162f28a0f9891d1150f47f72
with:
extra-packages:
any::checklist
any::covr
any::curl
any::cyclocomp
any::renv
any::roxygen2

- name: main branch
run: |
cd $GITHUB_WORKSPACE
CURRENT_COMMIT="$(git rev-parse HEAD)"
if git ls-remote --exit-code --heads origin main >/dev/null 2>&1; then
git fetch origin main:main --force
elif git ls-remote --exit-code --heads origin master >/dev/null 2>&1; then
git fetch origin master:master --force
else
echo "Neither main nor master branch found on origin." >&2
exit 1
fi
git checkout --force "$CURRENT_COMMIT"
shell: bash

- name: Check R package
run: |
pak::local_install(dependencies = TRUE, upgrade = TRUE, ask = FALSE)
citeme::get_default_org_list()
pak::pkg_install("inbo/checklist@0.5.4")
checklist::check_package()
covr::codecov(quiet = FALSE, commit="'$GITHUB_SHA'")
pkgdown::build_site(preview = FALSE)
shell: Rscript {0}

- name: "Check package with checklist"
uses: inbo/actions/check_pkg@composite
deploy-pages:
name: deploy to gh-pages
name: deploy-gh-pages
runs-on: ubuntu-24.04
needs: check-package
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'

runs-on: ubuntu-24.04

permissions:
contents: write

steps:

- name: Check out code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
fetch-depth: 0

- name: Check R package
run: checklist::set_tag()
shell: Rscript {0}

- name: Deploy docs to gh-pages
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Stash the built docs from the current workspace
DOCS_DIR="$GITHUB_WORKSPACE/docs"

if git ls-remote --exit-code --heads origin gh-pages >/dev/null 2>&1; then
# Branch exists: check it out and amend
git fetch origin gh-pages
git checkout gh-pages
# Remove existing site content, preserve .git
git rm -rf --ignore-unmatch .
cp -r "$DOCS_DIR/." .
git add -A
git commit --amend --no-edit --allow-empty
git push --force origin gh-pages
else
# Branch does not exist: create orphan branch
git checkout --orphan gh-pages
git rm -rf .
cp -r "$DOCS_DIR/." .
git add -A
git commit -m "Deploy pkgdown site to gh-pages"
git push origin gh-pages
fi
shell: bash
- name: "Tag and deploy gh-pages"
uses: inbo/actions/check_deploy@composite
30 changes: 0 additions & 30 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "citeme: Manage Person and Organisation Information",
"version": "0.1.2",
"version": "0.1.3",
"license": "GPL-3.0",
"upload_type": "software",
"description": "<p>Manage person and organisation information with validation and formatting capabilities. Provides R6 classes for managing organisations and their members, with support for multiple languages, ORCID identifiers, ROR identifiers, licensing requirements, publisher information, and integration with citation management systems.<\/p>",
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ abstract: "Manage person and organisation information with validation and format
identifiers:
- type: url
value: https://inbo.github.io/citeme/
version: 0.1.2
version: 0.1.3
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: citeme
Title: Manage Person and Organisation Information
Version: 0.1.2
Version: 0.1.3
Authors@R: c(
person("Thierry", "Onkelinx", , "thierry.onkelinx@inbo.be", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-8804-4216", affiliation = "Research Institute for Nature and Forest (INBO)")),
Expand Down Expand Up @@ -30,6 +30,7 @@ Imports:
Suggests:
mockery,
quarto,
rmarkdown,
testthat (>= 3.0.0)
VignetteBuilder:
quarto
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# citeme 0.1.3

* Handle `README` without language badge.

# citeme 0.1.2

* `ask_language()` now requires a vector of languages instead of an `org_list`.
Expand Down
6 changes: 5 additions & 1 deletion R/citation_meta_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ citation_meta <- R6Class(
},
stop("`path` type is not supported")
)
private$person <- meta$person
if (is.null(meta$person)) {
private$person <- person()
} else {
private$person <- meta$person
}
private$meta <- meta$meta
private$errors <- meta$errors
private$notes <- meta$notes
Expand Down
10 changes: 5 additions & 5 deletions R/citation_quarto.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
citation_quarto <- function(meta) {
assert_that(inherits(meta, "citation_meta"))
assert_that(meta$get_type == "quarto")
index_file <- file.path(meta$get_path, "_quarto.yml", fsep = "/")
if (!file_test("-f", index_file)) {
if (!file_test("-f", meta$get_path)) {
return(
list(
errors = paste(index_file, "not found"),
errors = paste(meta$get_path, "not found"),
warnings = character(0),
notes = character(0)
)
)
}
yaml <- read_yaml(index_file)
yaml <- quarto_yaml(meta$get_path)
language <- yaml$lang
if (has_name(yaml, "flandersqmd")) {
yaml <- yaml$flandersqmd
Expand All @@ -24,7 +23,8 @@ citation_quarto <- function(meta) {
yaml$lang <- coalesce(yaml$lang, language)
cit_meta <- yaml_individual(yaml = yaml)
cit_meta$warnings <- cit_meta$notes <- character(0)
description <- quarto_description(meta$get_path)
dirname(meta$get_path) |>
quarto_description() -> description
cit_meta$meta$description <- description$description
cit_meta$errors <- c(cit_meta$errors, description$errors)
cit_meta$meta$title <- paste0(
Expand Down
2 changes: 1 addition & 1 deletion R/quarto_description.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ quarto_description <- function(path) {
list() |>
setNames("text") |>
extract_description() -> description
if (has_name(description, "meta") || length(description$errors) > 0) {
if (length(description$errors) == 0) {
break
}
}
Expand Down
15 changes: 15 additions & 0 deletions R/quarto_yaml.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#' @importFrom utils file_test
#' @importFrom yaml read_yaml
quarto_yaml <- function(path) {
stopifnot("`path` is not an existing file" = file_test("-f", path))
if (basename(path) == "_quarto.yml") {
return(read_yaml(path))
}
stopifnot(
"please install the 'rmarkdown' package" = requireNamespace(
"rmarkdown",
quietly = TRUE
)
)
rmarkdown::yaml_front_matter(path)
}
13 changes: 8 additions & 5 deletions R/readme_badges.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,14 @@ readme_badges <- function(text) {
language_line <- grep(language_regexp, badges)
errors <- c(
errors,
"multiple language badges found in README.md"[length(language_line) > 1]
)
notes <- c(
notes,
"no language badge found in README.md"[length(language_line) == 0]
"multiple language badges found in README.md"[length(language_line) > 1],
paste(
"No language badge found in README.md.",
"Fix this first as it is required to properly handle individuals and",
"organisations.",
"Use `citeme::add_badges(language = \"en-GB\")` to add a language badge",
"to your `README.md`."
)[length(language_line) == 0]
)
if (length(language_line) == 1) {
meta$language <- gsub(language_regexp, "\\1", badges[language_line])
Expand Down
4 changes: 2 additions & 2 deletions inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ citHeader("To cite `citeme` in publications please use:")
# begin citeme entry
bibentry(
bibtype = "Manual",
title = "citeme: Manage Person and Organisation Information. Version 0.1.2",
title = "citeme: Manage Person and Organisation Information. Version 0.1.3",
author = c(person(given = "Thierry", family = "Onkelinx")),
year = 2026,
url = "https://inbo.github.io/citeme/",
abstract = "Manage person and organisation information with validation and formatting capabilities. Provides R6 classes for managing organisations and their members, with support for multiple languages, ORCID identifiers, ROR identifiers, licensing requirements, publisher information, and integration with citation management systems.",
textVersion = "Onkelinx, Thierry (2026) citeme: Manage Person and Organisation Information. Version 0.1.2. https://inbo.github.io/citeme/",
textVersion = "Onkelinx, Thierry (2026) citeme: Manage Person and Organisation Information. Version 0.1.3. https://inbo.github.io/citeme/",
keywords = "organisation; author; standardisation; inbo_version",
)
# end citeme entry
Loading
Loading