Skip to content

Commit

Permalink
Add CRAN release
Browse files Browse the repository at this point in the history
  • Loading branch information
doccstat committed Oct 1, 2023
1 parent 3f772da commit 4a8f5d9
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 12 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
46 changes: 46 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
clean: false
branch: gh-pages
folder: docs
58 changes: 52 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ options(cli.hyperlink = FALSE, eval = TRUE)

# abseil: Abseil Headers for R

[![CRAN status](https://www.r-pkg.org/badges/version-last-release/abseil)](https://cran.r-project.org/package=abseil)
[![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/abseil)](https://cran.r-project.org/package=abseil)
[![R-CMD-check](https://github.com/doccstat/abseil-r/workflows/R-CMD-check/badge.svg)](https://github.com/doccstat/abseil-r/actions)
[![Last Commit](https://img.shields.io/github/last-commit/doccstat/abseil-r)](https://github.com/doccstat/abseil-r)
[![r-universe](https://doccstat.r-universe.dev/badges/abseil)](https://doccstat.r-universe.dev)

### Synopsis
## Synopsis

This package provides [R](https://www.r-project.org) with access to
[Abseil](https://abseil.io) header files.
Expand All @@ -29,21 +32,51 @@ It can be used via the `LinkingTo:` field in the `DESCRIPTION` field of an R
package --- and the R package infrastructure tools will then know how to set
include flags correctly on all architectures supported by R.

### Installation
## Installation

```{r eval = FALSE}
# Install from CRAN
install.packages("abseil")
```

<details close>

<summary>Development version</summary>

```{r eval = FALSE}
# Development version from r-universe with CRAN version as a fallback
install.packages(
"abseil",
repos = c("https://doccstat.r-universe.dev", "https://cloud.r-project.org")
)
## install.packages("pak")
pak::pak("doccstat/abseil-r")
## install.packages("devtools")
devtools::install_github("doccstat/abseil-r")
```

### Example
</details>

## Example

```{r eval = FALSE}
Rcpp::cppFunction(r"{
#include "absl/strings/str_join.h"
std::string joinString() {
std::vector<std::string> v = {"foo","bar","baz"};
return absl::StrJoin(v, "-");
}
}", depends = "abseil")
joinString()
```

``` cpp
#include <Rcpp.h>
// [[Rcpp::depends(abseil)]]
#include "absl/strings/str_join.h"

//' @export
// [[Rcpp::export]]
std::string joinString() {
std::vector<std::string> v = {"foo","bar","baz"};
Expand All @@ -54,9 +87,22 @@ std::string joinString() {
Bare minimum R package using the `abseil` package can be found at
[doccstat/abseil-r-example](https://github.com/doccstat/abseil-r-example).

### Authors
## Authors

Abseil Team, Xingchi Li

## Contact us

For bugs related to Abseil logistics, please report the issue to the official
[Abseil GitHub Repo](https://github.com/abseil/abseil-cpp).

1. File a ticket at
[GitHub Issues](https://github.com/doccstat/abseil-r/issues).
2. Contact the authors specified in
[DESCRIPTION](https://github.com/doccstat/abseil-r/blob/main/DESCRIPTION#L5-L9).

Xingchi (Anthony) Li
## Stargazers over time
[![Stargazers over time](https://starchart.cc/doccstat/abseil-r.svg)](https://starchart.cc/doccstat/abseil-r)

## License

Expand Down
62 changes: 56 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@

# abseil: Abseil Headers for R

[![CRAN
status](https://www.r-pkg.org/badges/version-last-release/abseil)](https://cran.r-project.org/package=abseil)
[![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/abseil)](https://cran.r-project.org/package=abseil)
[![R-CMD-check](https://github.com/doccstat/abseil-r/workflows/R-CMD-check/badge.svg)](https://github.com/doccstat/abseil-r/actions)
[![Last
Commit](https://img.shields.io/github/last-commit/doccstat/abseil-r)](https://github.com/doccstat/abseil-r)
[![r-universe](https://doccstat.r-universe.dev/badges/abseil)](https://doccstat.r-universe.dev)

### Synopsis
## Synopsis

This package provides [R](https://www.r-project.org) with access to
[Abseil](https://abseil.io) header files.
Expand All @@ -19,21 +23,52 @@ It can be used via the `LinkingTo:` field in the `DESCRIPTION` field of
an R package — and the R package infrastructure tools will then know how
to set include flags correctly on all architectures supported by R.

### Installation
## Installation

``` r
# Install from CRAN
install.packages("abseil")
```

<details close>
<summary>
Development version
</summary>

``` r
# Development version from r-universe with CRAN version as a fallback
install.packages(
"abseil",
repos = c("https://doccstat.r-universe.dev", "https://cloud.r-project.org")
)

## install.packages("pak")
pak::pak("doccstat/abseil-r")

## install.packages("devtools")
devtools::install_github("doccstat/abseil-r")
```

### Example
</details>

## Example

``` r
Rcpp::cppFunction(r"{
#include "absl/strings/str_join.h"
std::string joinString() {
std::vector<std::string> v = {"foo","bar","baz"};
return absl::StrJoin(v, "-");
}
}", depends = "abseil")
joinString()
```

``` cpp
#include <Rcpp.h>
// [[Rcpp::depends(abseil)]]
#include "absl/strings/str_join.h"

//' @export
// [[Rcpp::export]]
std::string joinString() {
std::vector<std::string> v = {"foo","bar","baz"};
Expand All @@ -44,9 +79,24 @@ std::string joinString() {
Bare minimum R package using the `abseil` package can be found at
[doccstat/abseil-r-example](https://github.com/doccstat/abseil-r-example).

### Authors
## Authors

Abseil Team, Xingchi Li

## Contact us

For bugs related to Abseil logistics, please report the issue to the
official [Abseil GitHub Repo](https://github.com/abseil/abseil-cpp).

1. File a ticket at [GitHub
Issues](https://github.com/doccstat/abseil-r/issues).
2. Contact the authors specified in
[DESCRIPTION](https://github.com/doccstat/abseil-r/blob/main/DESCRIPTION#L5-L9).

## Stargazers over time

Xingchi (Anthony) Li
[![Stargazers over
time](https://starchart.cc/doccstat/abseil-r.svg)](https://starchart.cc/doccstat/abseil-r)

## License

Expand Down
12 changes: 12 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
url: https://abseil.xingchi.li
template:
bootstrap: 5
bslib:
base_font: {google: {family: "Source Sans Pro", wght: [400, 600], ital: [0, 1]}}
code_font: {google: "Source Code Pro"}
font_scale: 1.2
primary: "#447099"

authors:
Xingchi Li:
href: https://www.xingchi.li
32 changes: 32 additions & 0 deletions pkgdown/extra.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.template-home {
.page-header {
display: flex;
gap: 1rem;
align-items: center;
min-height: 0;
margin: 2rem 0;
padding: 2rem 0;
border-bottom: 1px solid #efefef;

h1 {
margin-top: 0rem;
}

@include media-breakpoint-down(sm) {
margin: 0.5rem 0;
padding: 0.5rem 0;
}
}
img.logo {
margin-left: 0;

@include media-breakpoint-down(sm) {
width: 100px;
}
}
}

nav.navbar {
border-bottom: 1px solid #efefef;
padding: 1rem 0;
}

0 comments on commit 4a8f5d9

Please sign in to comment.