Skip to content

Commit 05341dc

Browse files
committed
Update npm version scripts to manage new releases branch
This updates the `postversion.sh` script to merge master into the new `releases` branch and then copy and commit the version archives there, instead of into master, so that the archives aren't cluttering up the master branch unnecessarily.
1 parent fe65826 commit 05341dc

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

RELEASE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ The release process is mostly automated, here is a brief overview of the steps
99
- Updates `AUTHORS`
1010
- Updates `package.json` with new version
1111
- Creates a new git tag
12-
- Copies new release documentation into place in `docs/_releases/`, using the new release id
1312
2. `npm publish` publishes the new release to the npm registry
1413
3. `git push origin --follow-tags` pushes the changes to GitHub
14+
4. Archive the new release in the `releases` branch under the new release id
1515

1616
Each step is described in detail below.
1717

scripts/postversion.sh

+19-7
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,30 @@ node ./scripts/set-release-id-in-config-yml.cjs
1212
echo 'update changelog'
1313
./scripts/update-changelog-page.sh
1414

15+
echo 'commit changelog updates'
16+
git add docs/changelog.md
17+
git add docs/_config.yml
18+
git commit -n -m "Update docs/changelog.md and set new release id in docs/_config.yml"
19+
1520
echo 'build new package'
1621
node ./build.cjs
1722

18-
echo 'copying latest sinon to webpage assets'
19-
cp pkg/sinon.js ./docs/assets/js/
23+
echo 'publish to npm'
24+
git push --follow-tags && npm publish
25+
26+
# Now update the releases branch and archive the new release
27+
git checkout releases
28+
git merge master
2029

21-
echo 'copy new version'
30+
./scripts/copy-documentation-for-new-release.sh $PACKAGE_VERSION
31+
32+
echo 'copying new version to webpage assets'
33+
cp "./pkg/sinon.js" "./docs/assets/js/"
34+
35+
echo 'copy new version to release archive'
2236
cp "./pkg/sinon.js" "./docs/releases/sinon-$PACKAGE_VERSION.js"
2337

2438
git add "docs/releases/sinon-$PACKAGE_VERSION.js"
25-
git add docs/changelog.md
26-
git add docs/_config.yml
27-
git commit -n -m "Update docs/changelog.md and set new release id in docs/_config.yml"
39+
git commit -n -m "Add version $PACKAGE_VERSION to releases"
2840

29-
git push --follow-tags && npm publish
41+
git push && git checkout master

0 commit comments

Comments
 (0)