This directory contains example workflows that call r-wasm/actions's reusable workflows. Workflows should be stored in the .github/workflows directory of your repository.
On a push to the main branch on GitHub, it builds a CRAN-like repository for R WebAssembly and deploys the repo to GitHub Pages (in beta).
Great for groups and organizations using a meta GitHub repo to create a centralized R WebAssembly CRAN-like repository. Similar to CRAN, only the latest published repository version will persist.
- Checkout the GitHub repository
- Build the repository with
r-wasm/actions/build-cran-repo - Deploy the repository to GitHub pages with
actions/upload-pages-artifact
- packages (
'packages') - A string of R package references. If an empty value is provided (default), the workflow will read./packagesfile for the R package references. - compress (
true) - Compress Emscripten VFS images. Defaults totrue. Loading compressed VFS images requires at least version 0.4.1 of webR.
To leverage this reusable workflow, run the following R command in the root of your GitHub repository:
usethis::use_github_action(
url = "https://raw.githubusercontent.com/r-wasm/actions/v3/examples/deploy-cran-repo.yml"
)On a published GitHub release, it builds a WebAssembly file image and adds the files to a GitHub release.
This is typically used within R packages to build and release a WebAssembly R package library image of your package and its dependencies. Because the assets are tied to a release, they will never be overwritten are are stable over time.
- Checkout the GitHub repository
- Build the library image with
r-wasm/actions/build-cran-repo - Add the library image to the release with
svenstaro/upload-release-action
- packages (
'.') - A string of R package references. - strip (
NULL) - An R expression evaluating to a character vector of directories to remove when building the WebAssembly R package library image. To achieve a smaller bundle size, it is recommended to setstriptoc("demo", "doc", "examples", "help", "html", "include", "tests", "vignette"). - compress (
true) - Compress Emscripten VFS images. Defaults totrue. Loading compressed VFS images requires at least version 0.4.1 of webR.
To leverage this reusable workflow, run the following R command in the root of your GitHub repository:
usethis::use_github_action(
url = "https://raw.githubusercontent.com/r-wasm/actions/v3/examples/release-file-system-image.yml"
)