Skip to content

Commit 4c7b069

Browse files
authored
ci(release-process): setup stable branch for the client
1 parent 5c21e94 commit 4c7b069

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/publish-npm.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,20 @@ jobs:
3030
bash ./bin/publish-npm
3131
env:
3232
NPM_TOKEN: ${{ secrets.RUNLOOP_NPM_TOKEN || secrets.NPM_TOKEN }}
33+
34+
- name: Add stable tag to NPM release
35+
run: |
36+
npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"
37+
cd dist
38+
PACKAGE_NAME="$(jq -r -e '.name' ./package.json)"
39+
VERSION="$(jq -r -e '.version' ./package.json)"
40+
41+
# Only add stable tag if this is not a prerelease version
42+
if [[ ! "$VERSION" =~ -([a-zA-Z]+) ]]; then
43+
echo "Adding stable tag to version $VERSION"
44+
npm dist-tag add "$PACKAGE_NAME@$VERSION" stable
45+
else
46+
echo "Skipping stable tag for prerelease version $VERSION"
47+
fi
48+
env:
49+
NPM_TOKEN: ${{ secrets.RUNLOOP_NPM_TOKEN || secrets.NPM_TOKEN }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow allows manually setting the "stable" dist-tag to a specific version on NPM.
2+
# You can run this workflow by navigating to https://www.github.com/runloopai/api-client-ts/actions/workflows/set-stable-tag.yml
3+
name: Set Stable Tag
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: 'Version to tag as stable (e.g., 0.67.1)'
9+
required: true
10+
type: string
11+
12+
jobs:
13+
set-stable-tag:
14+
name: Set stable tag
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Node
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: '20'
24+
25+
- name: Set stable tag on NPM
26+
run: |
27+
npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"
28+
PACKAGE_NAME="@runloop/api-client"
29+
VERSION="${{ inputs.version }}"
30+
31+
echo "Setting stable tag to version $VERSION for package $PACKAGE_NAME"
32+
npm dist-tag add "$PACKAGE_NAME@$VERSION" stable
33+
34+
echo "Successfully set stable tag to $VERSION"
35+
echo "You can verify with: npm dist-tag ls $PACKAGE_NAME"
36+
env:
37+
NPM_TOKEN: ${{ secrets.RUNLOOP_NPM_TOKEN || secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)