|
1 | 1 | # Release |
2 | 2 |
|
3 | | -The `@shopify/checkout-sheet-kit` module is published to the NPM package |
4 | | -registry with public access. |
| 3 | +The `@shopify/checkout-sheet-kit` module is published to NPM with public access. |
5 | 4 |
|
6 | | -In order to publish a new version of the package, you must complete the |
7 | | -following steps: |
| 5 | +## Preparing for a release |
8 | 6 |
|
9 | | -1. Bump the version in `modules/@shopify/checkout-sheet-kit/package.json` to an |
10 | | - appropriate value. |
11 | | -2. Add a [Changelog](./CHANGELOG.md) entry. |
12 | | -3. Merge your PR to `main`. |
13 | | -4. Create a [Release](/releases) for your new version. |
| 7 | +Before creating a release, ensure the following version strings are updated and synchronized: |
14 | 8 |
|
15 | | -Creating and publishing a Github release with begin the automated process of |
16 | | -publishing the latest version of the package to NPM. It will clean the module |
17 | | -folder, build a new version, run `npm pack --dry-run` to verify the contents and |
18 | | -publish to the NPM registry. |
| 9 | +1. Bump the [package version](https://github.com/Shopify/checkout-sheet-kit-react-native/blob/main/modules/%40shopify/checkout-sheet-kit/package.json#L4) |
19 | 10 |
|
20 | | -You can follow the release action process via |
21 | | -https://github.com/Shopify/checkout-sheet-kit-react-native/actions/workflows/publish.yml. |
| 11 | +**Important**: The version in `package.json` must match the Git tag exactly, including any pre-release suffixes (e.g., `-alpha.1`, `-beta.1`, `-rc.1`). |
| 12 | + |
| 13 | +### Version format |
| 14 | + |
| 15 | +- **Production releases**: `X.Y.Z` (e.g., `3.5.0`) |
| 16 | +- **Pre-releases**: `X.Y.Z-{alpha|beta|rc}.N` (e.g., `3.5.0-alpha.1`, `3.5.0-beta.2`, `3.5.0-rc.1`) |
| 17 | + |
| 18 | +Pre-release suffixes ensure npm users must explicitly opt-in to install pre-release versions. |
| 19 | + |
| 20 | +## Creating a release |
| 21 | + |
| 22 | +Navigate to https://github.com/Shopify/checkout-sheet-kit-react-native/releases and click "Draft a new release", then complete the following steps: |
| 23 | + |
| 24 | +### For production releases (from `main` branch): |
| 25 | + |
| 26 | +1. Ensure you're on the `main` branch |
| 27 | +2. Create a tag for the new version (e.g., `3.5.0`) |
| 28 | +3. Use the same tag as the release title |
| 29 | +4. Document the full list of changes since the previous release, tagging merged pull requests where applicable |
| 30 | +5. ✅ Check "Set as the latest release" |
| 31 | +6. Click "Publish release" |
| 32 | + |
| 33 | +### For pre-releases (from non-`main` branch): |
| 34 | + |
| 35 | +1. Ensure you're on a feature/release branch (NOT `main`) |
| 36 | +2. Create a tag with a pre-release suffix (e.g., `3.5.0-alpha.1`, `3.5.0-beta.1`, `3.5.0-rc.2`) |
| 37 | +3. Use the same tag as the release title |
| 38 | +4. Document the changes being tested in this pre-release |
| 39 | +5. ✅ Check "Set as a pre-release" (NOT "Set as the latest release") |
| 40 | +6. Click "Publish release" |
| 41 | + |
| 42 | +## What happens after publishing |
| 43 | + |
| 44 | +When you publish a release (production or pre-release), the [publish workflow](https://github.com/Shopify/checkout-sheet-kit-react-native/actions/workflows/publish.yml) will automatically: |
| 45 | + |
| 46 | +1. **Validate versions**: Ensures `package.json` version matches the git tag |
| 47 | +2. **Determine npm tag**: Pre-releases (`-alpha`, `-beta`, `-rc`) publish to `next` tag, production releases publish to `latest` tag |
| 48 | +3. **Build and publish**: Publishes the version to npm |
| 49 | + |
| 50 | +## Using pre-releases |
| 51 | + |
| 52 | +For users to install a pre-release version: |
| 53 | + |
| 54 | +**npm** - Must specify the exact version or use the `next` tag: |
| 55 | +```bash |
| 56 | +npm install @shopify/ [email protected] |
| 57 | +# or |
| 58 | +npm install @shopify/checkout-sheet-kit@next |
| 59 | +``` |
| 60 | + |
| 61 | +**CocoaPods** - Must specify the exact version in Podfile: |
| 62 | +```ruby |
| 63 | +pod 'RNShopifyCheckoutSheetKit', '3.5.0-beta.1' |
| 64 | +``` |
| 65 | + |
| 66 | +## Troubleshooting |
| 67 | + |
| 68 | +**Version mismatch error**: Update `package.json` to match the git tag, then recreate the release. |
| 69 | + |
| 70 | +**Pre-release not on npm**: Verify version has suffix (`-alpha.1`, `-beta.1`, `-rc.1`) and "Set as a pre-release" was checked. |
| 71 | + |
| 72 | +**Wrong npm tag **: Manually fix with `npm dist-tag add @shopify/[email protected] latest` |
0 commit comments