Skip to content

Commit 2d74766

Browse files
feat: add beta release workflow for automated publishing and versioning (#121)
* feat: add beta release workflow for automated publishing and versioning * feat: enhance beta release workflow with version checks and PR categorization * feat: update beta release workflow to improve version checks and remove Git tagging
1 parent 5b233d8 commit 2d74766

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/beta-release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: "Beta Release"
2+
3+
on:
4+
push:
5+
branches:
6+
- beta
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
publish-beta:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: "Checkout source code"
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: "Set up Node.js"
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 22.x
25+
registry-url: "https://registry.npmjs.org/"
26+
27+
- name: "Install dependencies"
28+
run: npm ci
29+
30+
- name: "Create build"
31+
run: npm run build
32+
33+
- name: "Get version from package.json and create beta version"
34+
id: get_version
35+
run: |
36+
BASE_VERSION=$(node -p 'require("./package.json").version')
37+
BETA_VERSION="$BASE_VERSION-beta"
38+
echo "version=$BETA_VERSION" >> $GITHUB_OUTPUT
39+
echo "Beta version: $BETA_VERSION"
40+
41+
- name: "Check if beta version already exists on NPM"
42+
run: |
43+
BETA_VERSION=${{ steps.get_version.outputs.version }}
44+
# Check if version exists on npm
45+
if npm view @browserstack/mcp-server@$BETA_VERSION version 2>/dev/null; then
46+
echo "Error: Beta version $BETA_VERSION already exists on NPM!"
47+
exit 1
48+
fi
49+
echo "Beta version $BETA_VERSION is available for release"
50+
51+
- name: "Update package.json with beta version"
52+
run: |
53+
npm version ${{ steps.get_version.outputs.version }} --no-git-tag-version
54+
55+
- name: "Publish beta to NPM"
56+
run: npm publish --tag beta --access public
57+
env:
58+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)