Skip to content

Commit

Permalink
Update npm version scripts to manage new releases branch
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cincodenada committed Jan 24, 2022
1 parent fe65826 commit 05341dc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ The release process is mostly automated, here is a brief overview of the steps
- Updates `AUTHORS`
- Updates `package.json` with new version
- Creates a new git tag
- Copies new release documentation into place in `docs/_releases/`, using the new release id
2. `npm publish` publishes the new release to the npm registry
3. `git push origin --follow-tags` pushes the changes to GitHub
4. Archive the new release in the `releases` branch under the new release id

Each step is described in detail below.

Expand Down
26 changes: 19 additions & 7 deletions scripts/postversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,30 @@ node ./scripts/set-release-id-in-config-yml.cjs
echo 'update changelog'
./scripts/update-changelog-page.sh

echo 'commit changelog updates'
git add docs/changelog.md
git add docs/_config.yml
git commit -n -m "Update docs/changelog.md and set new release id in docs/_config.yml"

echo 'build new package'
node ./build.cjs

echo 'copying latest sinon to webpage assets'
cp pkg/sinon.js ./docs/assets/js/
echo 'publish to npm'
git push --follow-tags && npm publish

# Now update the releases branch and archive the new release
git checkout releases
git merge master

echo 'copy new version'
./scripts/copy-documentation-for-new-release.sh $PACKAGE_VERSION

echo 'copying new version to webpage assets'
cp "./pkg/sinon.js" "./docs/assets/js/"

echo 'copy new version to release archive'
cp "./pkg/sinon.js" "./docs/releases/sinon-$PACKAGE_VERSION.js"

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

git push --follow-tags && npm publish
git push && git checkout master

0 comments on commit 05341dc

Please sign in to comment.