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
46 changes: 46 additions & 0 deletions .github/workflows/continuous-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Every commit pushed to a branch of this repo gets an installable preview of
# the package, without publishing anything to npm:
#
# npm i https://pkg.pr.new/datocms/react-datocms@<commit-sha>
#
# The point is to cross a repo boundary while developing. A change here can be
# tried inside a site or a demo that lives in another repository from a real
# tarball, instead of `npm link` or pinning a git branch by hand and
# remembering to unpin it later. It also means a fix can be handed to whoever
# reported it before we cut a release.
#
# Pull requests opened from forks are deliberately not published: this runs on
# pushes to branches of *this* repo, which only people with write access can
# make, so an unreviewed fork cannot mint a URL under our namespace. If we ever
# want fork previews too, pkg.pr.new documents an "approved pull requests only"
# recipe that gates them behind a maintainer's review.
name: Continuous releases

on:
push:
# Every branch. Defining `branches` on its own also means tag pushes don't
# trigger this, which is what we want: a tag points at a commit that was
# already published when it landed on its branch.
branches: ["**"]

permissions: {}

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
# Pinned, and deliberately not the matrix `node.js.yml` runs: this
# job only has to build a tarball, not prove which Node versions the
# package supports.
node-version: 22
cache: "npm"
- run: npm ci
- run: npm run build
# No path argument: this is a single-package repo, so pkg-pr-new packs
# the working directory.
- run: npm exec -- pkg-pr-new publish --commentWithSha
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@ npm run start

---

# Trying a change before it's released

Every push to a branch here publishes a preview of the package, which you can
install anywhere — no npm release, no `npm link`:

```
npm i https://pkg.pr.new/datocms/react-datocms@<commit-sha>
```

The exact URL shows up in the commit's check run on GitHub, and in a comment on
the pull request once there is one. This is the supported way to try a change
inside a site that lives in another repository, or to hand a fix to whoever
reported it before it is released.

Previews are throwaway: they are never published to npm, and the URL stops
resolving after a while. Never commit one to a `package.json` that ships.

# What is DatoCMS?

<a href="https://www.datocms.com/"><img src="https://www.datocms.com/images/full_logo.svg" height="60" alt="DatoCMS - The Headless CMS for the Modern Web"></a>
Expand Down
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
],
"repository": {
"type": "git",
"url": "git://github.com/datocms/react-datocms.git"
"url": "git+https://github.com/datocms/react-datocms.git"
},
"license": "MIT",
"author": "Stefano Verna <s.verna@datocms.com>",
Expand All @@ -143,6 +143,7 @@
"intersection-observer": "^0.12.0",
"jest-environment-jsdom": "^29.7.0",
"np": "^10.0.7",
"pkg-pr-new": "^0.0.88",
"raf": "^3.4.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
Loading