Skip to content

Commit fcf3955

Browse files
committed
docs: Update RELEASING.md formatting
1 parent d5321ed commit fcf3955

File tree

1 file changed

+55
-29
lines changed

1 file changed

+55
-29
lines changed

RELEASING.md

Lines changed: 55 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,66 @@
1-
Releasing
1+
# Releasing
2+
23
We've moved to GitHub Actions for releases.
34

4-
How a release works
5-
Releases trigger when the repository recieves the custom repository_dispatch event release-triggered.
5+
## How a release works
6+
7+
Releases trigger when the repository recieves the custom repository_dispatch event
8+
`release-triggered`.
9+
10+
This triggers the `publish.yml` workflow, which in turn
11+
triggers the `release.sh` script in `scripts/ci`.
12+
The workflow will also create a github release with an appropriate changelog.
613

7-
This triggers the publish.yml workflow, which in turn triggers the release.sh script in scripts/ci. The workflow will also create a github release with an appropriate changelog.
14+
Having the release triggered by a custom event is useful for automating
15+
releases in the future (eg for version bumps in pact dependencies).
816

9-
Having the release triggered by a custom event is useful for automating releases in the future (eg for version bumps in pact dependencies).
17+
### Release.sh
1018

11-
Release.sh
12-
This script is not intended to be run locally. Note that it modifies your git settings.
19+
This script is not intended to be run locally. Note that it modifies your git
20+
settings.
1321

1422
The script will:
1523

16-
Modify git authorship settings
17-
Confirm that there would be changes in the changelog after release
18-
Run Lint
19-
Run Build
20-
Run Test
21-
Commit an appropriate version bump, changelog and tag
22-
Package and publish to npm
23-
Push the new commit and tag back to the main branch.
24-
Should you need to modify the script locally, you will find it uses some dependencies in scripts/ci/lib.
25-
26-
Kicking off a release
27-
You must be able to create a github access token with repo scope to the pact-js repository.
28-
29-
Set an environment variable GITHUB_ACCESS_TOKEN_FOR_PF_RELEASES to this token.
30-
Make sure master contains the code you want to release
31-
Run scripts/trigger-release.sh
24+
- Modify git authorship settings
25+
- Confirm that there would be changes in the changelog after release
26+
- Run Lint
27+
- Run Build
28+
- Run Test
29+
- Commit an appropriate version bump, changelog and tag
30+
- Package and publish to npm
31+
- Push the new commit and tag back to the main branch.
32+
33+
Should you need to modify the script locally, you will find it uses some
34+
dependencies in `scripts/ci/lib`.
35+
36+
## Kicking off a release
37+
38+
You must be able to create a github access token with `repo` scope to the
39+
jest-pact repository.
40+
41+
- Set an environment variable `GITHUB_ACCESS_TOKEN_FOR_PF_RELEASES` to this token.
42+
- Make sure master contains the code you want to release
43+
- Run `scripts/trigger-release.sh`
44+
3245
Then wait for github to do its magic. It will release the current head of master.
3346

34-
Note that the release script refuses to publish anything that wouldn't produce a changelog. Please make sure your commits follow the guidelines in CONTRIBUTING.md
47+
Note that the release script refuses to publish anything that wouldn't
48+
produce a changelog. Please make sure your commits follow the guidelines in
49+
`CONTRIBUTING.md`
50+
51+
## If the release fails
3552

36-
If the release fails
37-
The publish is the second to last step, so if the release fails, you don't need to do any rollbacks.
53+
The publish is the second to last step, so if the release fails, you don't
54+
need to do any rollbacks.
3855

39-
However, there is a potential for the push to fail after a publish if there are new commits to master since the release started. This is unlikely with the current commit frequency, but could still happen. Check the logs to determine if npm has a version that doesn't exist in the master branch.
56+
However, there is a potential for the push to fail _after_ a publish if there
57+
are new commits to master since the release started. This is unlikely with
58+
the current commit frequency, but could still happen. Check the logs to
59+
determine if npm has a version that doesn't exist in the master branch.
4060

4161
If this has happened, you will need to manually put the release commit in.
4262

63+
```
4364
# First delete the new tag
4465
# somehow this ends up in the repository
4566
# even though the push fails.
@@ -58,5 +79,10 @@ npm run release
5879
# Push that tag + commit
5980
git push origin master --follow-tags
6081
61-
Don't forget to create a new release in github.
62-
Depending on the nature of the new commits to master after the release, you may need to rebase them on top of the tagged release commit and force push (only do this if the released version would be different to the version tagged by npm run release)
82+
```
83+
84+
- Don't forget to create a new release in github.
85+
86+
Depending on the nature of the new commits to master after the release, you
87+
may need to rebase them on top of the tagged release commit and force push (only do this
88+
if the released version would be different to the version tagged by `npm run release`)

0 commit comments

Comments
 (0)