Skip to content

Commit c429bfd

Browse files
authored
Merge pull request #82 from KWB-R/dev
Release v0.1.7
2 parents 6a221d4 + 2319d01 commit c429bfd

16 files changed

Lines changed: 126 additions & 33 deletions

.github/workflows/pkgdown.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919

2020
- uses: r-lib/actions/setup-pandoc@master
2121

22+
- name: Install system dependencies
23+
if: runner.os == 'MacOS'
24+
run: brew install harfbuzz fribidi
25+
2226
- name: Query dependencies
2327
run: |
2428
install.packages('remotes')
@@ -36,6 +40,7 @@ jobs:
3640
- name: Install dependencies
3741
run: |
3842
remotes::install_deps(dependencies = TRUE)
43+
remotes::install_github("kwb-r/kwb.pkgbuild")
3944
install.packages("pkgdown", type = "binary")
4045
shell: Rscript {0}
4146

@@ -46,4 +51,5 @@ jobs:
4651
run: |
4752
git config --local user.email "actions@github.com"
4853
git config --local user.name "GitHub Actions"
49-
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
54+
Rscript -e 'kwb.pkgbuild::deploy_to_branch_with_extra_files()'
55+

.github/workflows/test-coverage.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222

2323
- uses: r-lib/actions/setup-pandoc@master
2424

25+
- name: Install system dependencies
26+
if: runner.os == 'MacOS'
27+
run: brew install harfbuzz fribidi
28+
2529
- name: Query dependencies
2630
run: |
2731
install.packages('remotes')

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: kwb.pkgbuild
22
Title: R package for standardised development at KWB
3-
Version: 0.1.6
3+
Version: 0.1.7
44
Authors@R:
55
c(person(given = "Michael",
66
family = "Rustler",

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
Copyright (c) 2018-2019 Kompetenzzentrum Wasser Berlin gGmbH (KWB)
3+
Copyright (c) 2018-2021 Kompetenzzentrum Wasser Berlin gGmbH (KWB)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
Copyright (c) 2018-2019 Kompetenzzentrum Wasser Berlin gGmbH (KWB)
3+
Copyright (c) 2018-2021 Kompetenzzentrum Wasser Berlin gGmbH (KWB)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

NAMESPACE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export(use_badge_appveyor)
1717
export(use_badge_codecov)
1818
export(use_badge_cran)
1919
export(use_badge_ghactions)
20+
export(use_badge_ghactions_pkgdown)
21+
export(use_badge_ghactions_rcmdcheck)
2022
export(use_badge_lifecycle)
2123
export(use_badge_travis)
2224
export(use_codecov)
@@ -42,6 +44,7 @@ importFrom(crayon,bold)
4244
importFrom(desc,desc)
4345
importFrom(desc,desc_get)
4446
importFrom(desc,desc_set)
47+
importFrom(fs,dir_copy)
4548
importFrom(fs,dir_create)
4649
importFrom(fs,dir_delete)
4750
importFrom(fs,dir_ls)

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# [kwb.pkgbuild 0.1.7](https://github.com/KWB-R/kwb.pkgbuild/releases/tag/v0.1.7) <small>2021-02-23</small>
2+
3+
* Improve re-usability of Github Actions badges (for R package `kwb.pkgstatus`)
4+
15
# [kwb.pkgbuild 0.1.6](https://github.com/KWB-R/kwb.pkgbuild/releases/tag/v0.1.6) <small>2020-11-24</small>
26

37
* Add function `deploy_to_branch_with_extra_files()` for using github-actions to

R/use_autopkgdown.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ use_autopkgdown <- function(
3939
# Create .gitlab-ci.yml for "main" branch with "docs" folder
4040
use_gitlab_ci_docs(dest_dir = file.path(dest_dir, repo))
4141

42-
# Update Github Actions
43-
use_ghactions()
44-
4542
# Delete .gitlab-ci.yml (if existing in "main" branch)
4643
fs::file_delete(".gitlab-ci.yml")
4744

R/use_badges.R

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,36 +42,71 @@ use_badge_travis <- function(repo = NULL, user = "KWB-R")
4242
)
4343
}
4444

45-
# use_badge_ghactions ----------------------------------------------------------
45+
# use_badge_ghactions_rcmdcheck ------------------------------------------------
4646

47-
#' Badge Github Actions
47+
#' Badge Github Actions RCMD Check
4848
#' @param repo name of repository (default: NULL)
4949
#' @param user user name or organisation under which repository defined in
5050
#' parameter "repo" is hosted (default: KWB-R")
51+
#' @param branch default: NULL (i.e. use "default" branch) or user defined branch
52+
#' (e.g. "dev")
5153
#' @return generates travis badge link
5254
#' @export
53-
use_badge_ghactions <- function(repo = NULL, user = "KWB-R")
55+
use_badge_ghactions_rcmdcheck <- function(repo = NULL, user = "KWB-R",
56+
branch = NULL)
5457
{
55-
sprintf("%s\n%s",
56-
5758
kwb.utils::resolve(
5859
"url",
5960
grammars$general,
6061
grammars$ghactions_rcmdcheck,
6162
user = user,
62-
pkgname = get_pkgname(repo)
63-
),
63+
pkgname = get_pkgname(repo),
64+
params = ifelse(is.null(branch), "", sprintf("?branch=%s", branch))
65+
66+
)
67+
68+
}
69+
70+
#' Badge Github Actions Pkgdown
71+
#' @param repo name of repository (default: NULL)
72+
#' @param user user name or organisation under which repository defined in
73+
#' parameter "repo" is hosted (default: KWB-R")
74+
#' @param branch default: NULL (i.e. use "default" branch) or user defined branch
75+
#' (e.g. "dev")
76+
#' @return generates Github Actions Pkgdown badge link
77+
#' @export
78+
use_badge_ghactions_pkgdown <- function(repo = NULL, user = "KWB-R", branch = NULL)
79+
{
6480
kwb.utils::resolve(
6581
"url",
6682
grammars$general,
6783
grammars$ghactions_pkgdown,
6884
user = user,
69-
pkgname = get_pkgname(repo)
70-
)
85+
pkgname = get_pkgname(repo),
86+
params = ifelse(is.null(branch), "", sprintf("?branch=%s", branch))
7187
)
7288

7389
}
7490

91+
# use_badge_ghactions ----------------------------------------------------------
92+
93+
#' Badge Github Actions
94+
#' @param repo name of repository (default: NULL)
95+
#' @param user user name or organisation under which repository defined in
96+
#' parameter "repo" is hosted (default: KWB-R")
97+
#' @param branch default: NULL (i.e. use "default" branch) or user defined branch
98+
#' (e.g. "dev")
99+
#' @return generates Github Actions badges link
100+
#' @export
101+
use_badge_ghactions <- function(repo = NULL, user = "KWB-R", branch = NULL)
102+
{
103+
sprintf("%s\n%s",
104+
use_badge_ghactions_rcmdcheck(repo, user, branch),
105+
use_badge_ghactions_pkgdown(repo, user, branch)
106+
)
107+
}
108+
109+
75110
# use_badge_codecov ------------------------------------------------------------
76111

77112
#' Badge codecov

R/use_codecov.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#' @export
77
use_codecov <- function()
88
{
9-
usethis:::check_uses_travis()
9+
usethis:::check_uses_github_actions()
1010
usethis:::use_dependency("covr", "Suggests")
1111

1212
if (! usethis::use_template("codecov.yml", ignore = TRUE)) {

0 commit comments

Comments
 (0)