Skip to content

Commit 2a73d4b

Browse files
authored
Fix prerelease publishing (#1764)
* Fix pre-release publishing Allows 'prerelease' as a version argument to increment RC versions. Ensures that the version bump commit and tag are pushed to GitHub even for pre-releases, preventing subsequent runs from attempting to publish the same version. * Update package version and fix pre-release publishing script Manually updated package.json to 7.0.0-rc.0 to match npm. Updated publish.sh to correctly handle prerelease argument and push commits. * Add comment explaining second git push
1 parent 92bc127 commit 2a73d4b

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firebase-functions",
3-
"version": "6.6.0",
3+
"version": "7.0.0-rc.0",
44
"description": "Firebase SDK for Cloud Functions",
55
"keywords": [
66
"firebase",

scripts/publish.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ VERSION=$1
1414
if [[ $VERSION == "" ]]; then
1515
printusage
1616
exit 1
17-
elif [[ ! ($VERSION == "patch" || $VERSION == "minor" || $VERSION == "major") ]]; then
17+
elif [[ ! ($VERSION == "patch" || $VERSION == "minor" || $VERSION == "major" || $VERSION == "prerelease") ]]; then
1818
printusage
1919
exit 1
2020
fi
@@ -89,7 +89,11 @@ echo "Ran publish build."
8989

9090
echo "Making a $VERSION version..."
9191
if [[ $PRE_RELEASE != "" ]]; then
92-
npm version pre$VERSION --preid=rc
92+
if [[ $VERSION == "prerelease" ]]; then
93+
npm version prerelease --preid=rc
94+
else
95+
npm version pre$VERSION --preid=rc
96+
fi
9397
else
9498
npm version $VERSION
9599
fi
@@ -118,6 +122,10 @@ fi
118122
npm publish "${PUBLISH_ARGS[@]}"
119123
echo "Published to npm."
120124

125+
echo "Pushing to GitHub..."
126+
git push origin master --tags
127+
echo "Pushed to GitHub."
128+
121129
if [[ $PRE_RELEASE != "" ]]; then
122130
echo "Published a pre-release version. Skipping post-release actions."
123131
exit
@@ -136,6 +144,7 @@ git commit -m "[firebase-release] Removed change log and reset repo after ${NEW_
136144
echo "Cleaned up release notes."
137145

138146
echo "Pushing to GitHub..."
147+
# Push the changelog cleanup commit.
139148
git push origin master --tags
140149
echo "Pushed to GitHub."
141150

0 commit comments

Comments
 (0)