Skip to content

Commit b7fddd1

Browse files
committed
Update Publish docs and add alpha releases
1. Update documenation for releases and include link in contributing guide 2. Add support for `alpha` releases to the publishing action
1 parent 2f00545 commit b7fddd1

File tree

3 files changed

+104
-18
lines changed

3 files changed

+104
-18
lines changed

.github/workflows/publish.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,47 @@ jobs:
1717
- name: Setup
1818
uses: ./.github/actions/setup
1919

20+
- name: Validate versions match
21+
id: validate-versions
22+
run: |
23+
# Extract version from package.json
24+
PACKAGE_VERSION=$(node -p "require('./modules/@shopify/checkout-sheet-kit/package.json').version")
25+
26+
# Extract Git tag from release
27+
GIT_TAG="${{ github.event.release.tag_name }}"
28+
29+
echo "📦 package.json version: $PACKAGE_VERSION"
30+
echo "🏷️ Git tag: $GIT_TAG"
31+
32+
# Compare versions
33+
if [ "$PACKAGE_VERSION" != "$GIT_TAG" ]; then
34+
echo ""
35+
echo "❌ ERROR: Version mismatch detected!"
36+
echo ""
37+
echo "The version in package.json ($PACKAGE_VERSION) does not match the Git tag ($GIT_TAG)."
38+
echo ""
39+
echo "Please ensure the following are updated before creating a release:"
40+
echo " 1. modules/@shopify/checkout-sheet-kit/package.json"
41+
echo " 2. Git tag should match package.json version exactly"
42+
echo ""
43+
echo "For pre-releases, use format: X.Y.Z-beta.N or X.Y.Z-rc.N"
44+
echo ""
45+
exit 1
46+
fi
47+
48+
echo ""
49+
echo "✅ All versions match! Proceeding with release..."
50+
echo ""
51+
2052
- name: Determine NPM tag
2153
id: npm-tag
2254
run: |
2355
# Read the version from package.json
2456
VERSION=$(node -p "require('./modules/@shopify/checkout-sheet-kit/package.json').version")
2557
26-
# Check if it's a "beta" or "rc" version
27-
if [[ "$VERSION" == *"-beta"* ]] || [[ "$VERSION" == *"-rc"* ]]; then
28-
echo "Version $VERSION is a prerelease, using 'next' tag"
58+
# Check if it's a pre-release version (alpha, beta, or rc)
59+
if [[ "$VERSION" == *"-alpha"* ]] || [[ "$VERSION" == *"-beta"* ]] || [[ "$VERSION" == *"-rc"* ]]; then
60+
echo "Version $VERSION is a pre-release, using 'next' tag"
2961
echo "tag=next" >> $GITHUB_OUTPUT
3062
else
3163
echo "Version $VERSION is a stable release, using 'latest' tag"

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
We welcome code contributions, feature requests, and reporting of issues. Please
44
see [guidelines and instructions](.github/CONTRIBUTING.md).
55

6+
For information about creating releases and publishing new versions, see the
7+
[Release Documentation](docs/contributing/release.md).
8+
69
---
710

811
This repo is subdivided into 3 parts using yarn workspaces:

docs/contributing/release.md

Lines changed: 66 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,72 @@
11
# Release
22

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.
54

6-
In order to publish a new version of the package, you must complete the
7-
following steps:
5+
## Preparing for a release
86

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:
148

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)
1910

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

Comments
 (0)