Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 121953f

Browse files
authored
Merge pull request #642 from cloudflare/cina/release-script
Add release script
2 parents acd98d3 + fdd6ad9 commit 121953f

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"lint": "eslint \"packages/*/{src,test}/**/*.ts\" \"scripts/**/*.{js,mjs}\" \"types/**/*.ts\"",
2727
"lint:fix": "npm run lint -- --fix",
2828
"prepublishOnly": "npm run lint && npm run clean && npm run build && npm run types:bundle && npm run test",
29+
"release": "./scripts/release.sh",
2930
"test": "npm run build && ava && rimraf ./.tmp",
3031
"types:build": "tsc && tsc -p packages/miniflare/src/workers/tsconfig.json",
3132
"types:bundle": "npm run types:build && node scripts/types.mjs"

scripts/release.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
MINOR="$1"
5+
6+
if [ -z "$MINOR" ]; then
7+
echo "Missing version argument"
8+
echo " Usage: ${0} <workerd-minor-version>"
9+
exit 1
10+
fi
11+
12+
MINIFLARE_VERSION="3.${MINOR}.0"
13+
WORKERD_VERSION="1.${MINOR}.0"
14+
15+
# checkout a new branch
16+
git fetch origin tre:tre
17+
git checkout -b "${USER}/v${MINIFLARE_VERSION}" tre
18+
19+
# update workerd
20+
npm install --workspace miniflare "workerd@${WORKERD_VERSION}"
21+
22+
# bump version and commit and tag release
23+
npm version "$MINIFLARE_VERSION" --force --include-workspace-root --workspace miniflare -m "Bump versions to %s"
24+
25+
git push -u "${USER}/v${MINIFLARE_VERSION}"
26+
git push --tags
27+
28+
# publish to npm
29+
npm run prepublishOnly
30+
npm publish -ws

0 commit comments

Comments
 (0)