Skip to content

Commit dd018e9

Browse files
committed
internal: Add beta changesets release
1 parent 222e32f commit dd018e9

File tree

4 files changed

+113
-0
lines changed

4 files changed

+113
-0
lines changed

.changeset/BETA_RELEASE.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Beta Release Guide
2+
3+
This project now supports beta releases using changesets. Here's how to use it:
4+
5+
## Automatic Beta Releases
6+
7+
Beta releases are automatically triggered when:
8+
1. Changes are pushed to the `beta` branch
9+
2. The workflow is manually triggered via GitHub Actions
10+
11+
## Manual Beta Release
12+
13+
You can manually trigger a beta release by:
14+
15+
1. Go to the GitHub Actions tab
16+
2. Select "Beta Release" workflow
17+
3. Click "Run workflow"
18+
4. Choose the beta tag (default: `beta`)
19+
5. Click "Run workflow"
20+
21+
## Beta Release Process
22+
23+
1. **Versioning**: Uses `changeset version --snapshot beta` to create beta versions
24+
2. **Publishing**: Publishes packages with the `beta` tag to npm
25+
3. **Version Format**: Beta versions follow the pattern `{version}-beta-{datetime}-{commit}`
26+
27+
## Installing Beta Packages
28+
29+
Users can install beta versions using:
30+
31+
```bash
32+
npm install @data-client/react@beta
33+
# or
34+
yarn add @data-client/react@beta
35+
```
36+
37+
## Creating Changesets for Beta
38+
39+
To create a changeset for beta release:
40+
41+
```bash
42+
yarn changeset
43+
```
44+
45+
Then select the packages and changes you want to include in the beta release.
46+
47+
## Local Beta Testing
48+
49+
To test beta releases locally:
50+
51+
```bash
52+
# Create beta version
53+
yarn changeset:version:beta
54+
55+
# Build and publish locally (for testing)
56+
yarn changeset:publish:beta
57+
```
58+
59+
## Notes
60+
61+
- Beta releases are published with the `beta` tag on npm
62+
- The workflow creates a pull request for version bumps
63+
- Beta versions are automatically calculated with timestamps and commit hashes
64+
- All linked packages are versioned together

.changeset/config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
"access": "public",
1919
"baseBranch": "master",
2020
"updateInternalDependencies": "patch",
21+
"snapshot": {
22+
"useCalculatedVersion": true,
23+
"prereleaseTemplate": "{tag}-{datetime}-{commit}"
24+
},
2125
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
2226
"onlyUpdatePeerDependentsWhenOutOfRange": true
2327
},

.github/workflows/beta-release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Beta Release
2+
3+
on:
4+
push:
5+
branches:
6+
- beta
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Beta tag (e.g., beta, alpha, rc)'
11+
required: true
12+
default: 'beta'
13+
type: string
14+
15+
concurrency: ${{ github.workflow }}-${{ github.ref }}
16+
17+
jobs:
18+
beta-release:
19+
name: Beta Release
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v5
24+
- uses: actions/setup-node@v5
25+
with:
26+
node-version: '22'
27+
cache: 'yarn'
28+
- name: Install packages
29+
run: |
30+
corepack enable
31+
yarn install --immutable
32+
33+
- name: Create Beta Release Pull Request or Publish to npm
34+
id: changesets
35+
uses: changesets/action@v1
36+
with:
37+
version: yarn changeset:version:beta
38+
publish: yarn changeset:publish:beta
39+
commit: "internal: Publish beta version"
40+
title: "Version Packages (Beta)"
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"scripts": {
1313
"changeset:version": "run changeset version && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install",
1414
"changeset:publish": "run build && run changeset publish",
15+
"changeset:version:beta": "run changeset version --snapshot beta && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install",
16+
"changeset:publish:beta": "run build && run changeset publish --tag beta",
1517
"lint": "eslint",
1618
"format": "eslint --fix \"packages/*/src/**/*.{js,ts,tsx,cts}\"",
1719
"clean:types": "rimraf packages/*/*.tsbuildinfo",

0 commit comments

Comments
 (0)