File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33PACKAGE_VERSION=$( node -p -e " require('./package.json').version" )
4- ARCHIVE_BRANCH=" releases"
4+ ARCHIVE_BRANCH=${ARCHIVE_BRANCH :- releases}
55SOURCE_BRANCH=$( git rev-parse --abbrev-ref HEAD)
66
77echo ' postversion tasks'
88
99# npm publish will generate the pkg/sinon.js that we use below
1010echo ' publish to npm'
11- git push --follow-tags
12- npm publish
11+ if [ -n " $DRY_RUN " ]; then
12+ npm publish --dry-run
13+ else
14+ git push --follow-tags
15+ npm publish
16+ fi
1317
1418# Now update the releases branch and archive the new release
19+ echo " archiving release from $SOURCE_BRANCH to $ARCHIVE_BRANCH "
1520git checkout $ARCHIVE_BRANCH
1621git merge --no-edit -m " Merge version $PACKAGE_VERSION " $SOURCE_BRANCH
1722
@@ -27,5 +32,5 @@ cp "pkg/sinon.js" "./docs/releases/sinon-$PACKAGE_VERSION.js"
2732git add " docs/releases/sinon-$PACKAGE_VERSION .js"
2833git commit -n -m " Add version $PACKAGE_VERSION to releases"
2934
30- git push
35+ [ -n " $DRY_RUN " ] || git push
3136git checkout $SOURCE_BRANCH
You can’t perform that action at this time.
0 commit comments