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
17 changes: 16 additions & 1 deletion .claude/skills/release-shinyreact/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ does **not** oblige releasing the others.
|---|---|---|---|
| `shinyreact` (PyPI) | `pyproject.toml` (repo root) `version` | `py/v1.2.3` | `.github/workflows/release-py.yaml` |
| `@posit-dev/shinyreact` (npm) | `pkg-js/package.json` `version` | `js/v1.2.3` | `.github/workflows/release-js.yaml` — **stages only, a human approves** |
| `shinyreact` (R) | `pkg-r/DESCRIPTION` `Version` | `r/v1.2.3` | none — CRAN is a manual submission |
| `shinyreact` (R) | `pkg-r/DESCRIPTION` `Version` | `r/v1.2.3` | `.github/workflows/release-r-wasm.yaml` attaches wasm assets to the GitHub release — CRAN itself is a manual submission |

The `<lang>/v` prefix is what keeps the three apart; nothing else distinguishes
them. A bare `v1.2.3` tag triggers nothing.
Expand Down Expand Up @@ -148,6 +148,21 @@ Two things the generated checklist does not know about:
- Its "tag the release" bullet means `r/v1.2.3` here, not `v1.2.3`. Tag after
CRAN accepts, then `gh release create r/v1.2.3 --generate-notes`.

Creating that GitHub release also fires `release-r-wasm.yaml`, which builds a
webR filesystem image of the package plus its dependencies and attaches
`library.data.gz` + `library.js.metadata` to the release. That is what lets a
shinylive app install shinyreact from GitHub (#268):

```r
pak::pak("posit-dev/shinyreact/pkg-r@r/v1.2.3")
```

shinylive resolves the assets by the ref recorded at install time, so **the
release tag and the ref users install must be the same string** — `r/v1.2.3`.
The workflow pins `ghcr.io/r-wasm/webr:v0.6.0` to match the webR that shinylive
ships; bump it when shinylive's R version moves. Once shinyreact is on CRAN and
mirrored to repo.r-wasm.org, this matters only for dev installs.

If `use_release_issue()` is unavailable, `open-source:create-release-checklist`
produces the same tidyverse checklist.

Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/release-r-wasm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: release-r-wasm

# Attaches WebAssembly assets (`library.data.gz` + `library.js.metadata`) to an
# `r/v*` GitHub release, so shinylive can install the R package from GitHub.
#
# shinylive:::get_github_wasm_assets() looks up
# /repos/posit-dev/shinyreact/releases/tags/<RemoteRef> and expects those two
# assets, where <RemoteRef> is whatever ref the user installed:
#
# pak::pak("posit-dev/shinyreact/pkg-r@r/v0.1.0") # RemoteRef: "r/v0.1.0"
#
# So the release tag and the install ref must be the same string. A slash in the
# ref is fine for both pak and the GitHub API.
#
# Until shinyreact is on CRAN (and so on repo.r-wasm.org), this release is the
# only way a shinylive app can `library(shinyreact)`. See #268.
#
# `release` events only run workflows from the default branch, so this file must
# be on main before the release is created.

on:
release:
types: [published]

jobs:
wasm:
if: startsWith(github.event.release.tag_name, 'r/v')
permissions:
contents: write
repository-projects: read
uses: r-wasm/actions/.github/workflows/release-file-system-image.yml@v3
with:
packages: local::./pkg-r
strip: "demo, doc, examples, help, html, include, tests, vignette"
# Pin to the webR release shinylive ships (0.6.0 / R 4.6.0). A wasm binary
# built against a different R version won't load.
webr-image: ghcr.io/r-wasm/webr:v0.6.0