File tree 1 file changed +9
-4
lines changed 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e
3
3
PACKAGE_VERSION=$( node -p -e " require('./package.json').version" )
4
- ARCHIVE_BRANCH=" releases"
4
+ ARCHIVE_BRANCH=${ARCHIVE_BRANCH :- releases}
5
5
SOURCE_BRANCH=$( git rev-parse --abbrev-ref HEAD)
6
6
7
7
echo ' postversion tasks'
8
8
9
9
# npm publish will generate the pkg/sinon.js that we use below
10
10
echo ' 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
13
17
14
18
# Now update the releases branch and archive the new release
19
+ echo " archiving release from $SOURCE_BRANCH to $ARCHIVE_BRANCH "
15
20
git checkout $ARCHIVE_BRANCH
16
21
git merge --no-edit -m " Merge version $PACKAGE_VERSION " $SOURCE_BRANCH
17
22
@@ -27,5 +32,5 @@ cp "pkg/sinon.js" "./docs/releases/sinon-$PACKAGE_VERSION.js"
27
32
git add " docs/releases/sinon-$PACKAGE_VERSION .js"
28
33
git commit -n -m " Add version $PACKAGE_VERSION to releases"
29
34
30
- git push
35
+ [ -n " $DRY_RUN " ] || git push
31
36
git checkout $SOURCE_BRANCH
You can’t perform that action at this time.
0 commit comments