Skip to content

Commit

Permalink
Adjust deploy scripts to archive old releases in a separate branch, m…
Browse files Browse the repository at this point in the history
…ove existing releases out of master (#2426)

* Remove release archives from master

These archives made it difficult to find things in the GitHub interface,
and take up a lot of space in a checked-out repo for something that is
not useful to most people checking out the repository.

The main purpose of these archives is to make old versions and
documentation available on the Sinon website that is run out of this
repo. This can be supported by using a separate branch for website
releases, and to maintain the archives.

Following this commit, the `npm version` scripts will be updated to
automatically handle archiving the releases in the new releases branch
and keeping it up to date with master.

Also remove the directories we removed from .prettierignore, since they
don't exist any more.

* 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.

* Move changelog updates into version script

Previously we were updating the changelog and doing other auxiliary
version bumps in the post-version script, which meant they weren't
included in the tagged release commit, and required a followup commit.

This moves the version-bumping changes into a new `version.sh` script,
so that those changes show up in the tagged version commit.

* Don't ignore changelogs in prettier

We were manually running prettier on CHANGELOG.md during release but
ignoring it in .prettierrc - this may have been a holdover from before
Prettier had the proseWrap option, which would have wreacked havoc with
the changelog, but the current version handles things just fine.

* Merge silently into the archive branch

We shouldn't ever have conflicts here, so we can just auto-merge

* Tweak changelog.md generation to be more compatible

$(<CHANGES.md) wasn't working on my machine, I think because it's a
bash-ism, and my machine was running it under sh. I also took the chance
to do something more useful than just `cat` by removing the double
header that was previously on this page.

* Fail if we cancel CHANGES.md

Also make version.sh a bash script like the others - this would have
fixed the update-change-log-page script, in retrospect, but I think it's
worth getting rid of the double header anyway.

* Clean up copied directories

Otherwise when we switch back to the source branch we'll have these
files left dangling, which was what we were trying to avoid in the first
place

* Don't defeat set -e

Stringing commands together like this makes it so if the push doesn't
work, we keep going, which we don't want!

* Temporary commit to make publish a dry-run

This makes the script work on my machine, since I of course can't
actually publish to sinon's npm package

Also skip postbuild because chrome tests aren't working on my machine
and `npm install` doesn't fix it

* 12.0.2

Co-authored-by: Carl-Erik Kopseng <carlerik@gmail.com>
  • Loading branch information
cincodenada and fatso83 authored Jan 28, 2022
1 parent c80a726 commit 4171046
Show file tree
Hide file tree
Showing 2,582 changed files with 55 additions and 2,598,505 deletions.
4 changes: 0 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ tmp/
.sass-cache
docs/_site/
docs/js/
docs/releases/
docs/_releases/
docs/assets/js/
CHANGELOG.md
docs/changelog.md
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## 12.0.2

_Released by [Carl-Erik Kopseng](https://github.com/fatso83) on 2022-01-27._

## 12.0.1

- [`3f598221`](https://github.com/sinonjs/sinon/commit/3f598221045904681f2b3b3ba1df617ed5e230e3)
Expand Down
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
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
url: 'https://sinonjs.org'
github_username: sinonjs
sinon:
current_release: v12.0.1
current_release: v12.0.2
markdown: kramdown
kramdown:
input: GFM
Expand Down
39 changes: 0 additions & 39 deletions docs/_releases/latest.md

This file was deleted.

190 changes: 0 additions & 190 deletions docs/_releases/latest/assertions.md

This file was deleted.

17 changes: 0 additions & 17 deletions docs/_releases/latest/examples/.eslintrc.yml

This file was deleted.

1 change: 0 additions & 1 deletion docs/_releases/latest/examples/.gitignore

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions docs/_releases/latest/examples/fakes-10-firstArg.test.js

This file was deleted.

21 changes: 0 additions & 21 deletions docs/_releases/latest/examples/fakes-11-lastArg.test.js

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4171046

Please sign in to comment.