Skip to content

Commit 5f67804

Browse files
support more npm tags (#2405)
* support more npm tags * update docs
1 parent 44beac7 commit 5f67804

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,9 @@ jobs:
124124
npm config set //registry.npmjs.org/:_authToken $NPM_AUTH_TOKEN
125125
# print the NPM user name for validation
126126
npm whoami
127-
VERSION=$(node -p "require('./package.json').version" )
128-
# Only publish stable versions to the latest tag
129-
if [[ "$VERSION" =~ ^[^-]+$ ]]; then
130-
NPM_TAG="latest"
131-
else
132-
NPM_TAG="beta"
133-
fi
127+
VERSION=$(< package.json | jq -r '.version')
128+
# use the tag correlating to this release channel
129+
NPM_TAG=$(< package.json | jq -r '.version | if contains("beta") then "public-preview" else if contains("alpha") then "private-preview" else "latest" end end')
134130
echo "Publishing $VERSION with $NPM_TAG tag."
135131
npm publish --otp="$(oathtool -b --totp $NPM_OTP)" --tag $NPM_TAG
136132
env:

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,13 +525,21 @@ const stripe = new Stripe('sk_test_...', {
525525

526526
### Public Preview SDKs
527527

528-
Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-beta.X` suffix like `15.2.0-beta.2`.
528+
Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-beta.X` suffix like `18.6.0-beta.1`.
529529
We would love for you to try these as we incrementally release new features and improve them based on your feedback.
530530

531-
To install, pick the latest version with the `beta` suffix by reviewing the [releases page](https://github.com/stripe/stripe-node/releases/) and use it in the below command
531+
The easiest way to install a public-preview release is to use the dedicated npm tag:
532532

533533
```
534-
npm install stripe@<replace-with-the-version-of-your-choice> --save
534+
npm install stripe@public-preview --save
535+
```
536+
537+
Or, to install a specific version from the [releases page](https://github.com/stripe/stripe-node/releases/), you can specify that version explicitly:
538+
539+
```
540+
npm install stripe@<some-version>
541+
# for example:
542+
# npm install [email protected]
535543
```
536544

537545
> **Note**
@@ -547,7 +555,11 @@ const stripe = new Stripe('sk_test_...', {
547555

548556
### Private Preview SDKs
549557

550-
Stripe has features in the [private preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-alpha.X` suffix like `15.2.0-alpha.2`. These are invite-only features. Once invited, you can install the private preview SDKs by following the same instructions as for the [public preview SDKs](https://github.com/stripe/stripe-node?tab=readme-ov-file#public-preview-sdks) above and replacing the term `beta` with `alpha`.
558+
Stripe has features in the [private preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-alpha.X` suffix like `18.6.0-alpha.1`. These are invite-only features. Once invited, you can install the private preview SDKs by following the same instructions as for the [public preview SDKs](https://github.com/stripe/stripe-node?tab=readme-ov-file#public-preview-sdks) above and replacing the term `public-preview` with `private-preview`:
559+
560+
```
561+
npm install stripe@private-preview --save
562+
```
551563

552564
### Custom requests
553565

0 commit comments

Comments
 (0)