You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
6
13
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).
8
16
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
10
18
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.
13
21
14
22
The script will:
15
23
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
+
32
45
Then wait for github to do its magic. It will release the current head of master.
33
46
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
35
52
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.
38
55
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.
40
60
41
61
If this has happened, you will need to manually put the release commit in.
42
62
63
+
```
43
64
# First delete the new tag
44
65
# somehow this ends up in the repository
45
66
# even though the push fails.
@@ -58,5 +79,10 @@ npm run release
58
79
# Push that tag + commit
59
80
git push origin master --follow-tags
60
81
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