Skip to content

Commit 794eb4c

Browse files
authored
Fix flaky npm github release (#1225)
1 parent 171080c commit 794eb4c

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

.buildkite/pipeline.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ steps:
229229
- PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 HUSKY=0 yarn install --immutable
230230
- echo "+++ Release packages"
231231
- yarn release
232+
- |
233+
curl -X POST -H "Accept: application/vnd.github.v3+json" \
234+
-H "Authorization: token $${GITHUB_TOKEN}" \
235+
https://api.github.com/repos/segmentio/analytics-next/actions/workflows/release-creator.yml/dispatches \
236+
-d '{"ref":"master"}'
232237
plugins:
233238
- ssh://[email protected]/segmentio/cache-buildkite-plugin#v2.0.0:
234239
key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}"

.github/workflows/create-github-release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# Creating the github release is the final step of the release.
22
name: Create Github Release
33
on:
4-
push:
5-
tags:
6-
- "@segment/*"
4+
workflow_dispatch:
75

86
jobs:
97
github_release:

RELEASING.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,22 @@ Information is in the [@changesets automation instructions](https://github.com/c
5050
[Check out the @changesets automation instructions](https://github.com/changesets/changesets/blob/main/docs/automating-changesets.md#automating-changesets)
5151

5252
### What does `yarn release` do?
53-
- run prepare scripts
54-
- publish all packages to npm
55-
- pushes tags to repo
56-
- triggers a github release on CI (via tags)
57-
- triggers a CDN release
53+
1. Run prepare scripts
54+
2. Publish all packages to npm, pushes _all_ tags to github (e.g. "@segment/analytics-next@1.7.0", "@segment/analytics-node@1.2.3", etc) (Buildkite)
55+
3. Triggets an update of the github releases page (Github Actions)
5856

59-
### I don't want to use automation, how do I manually create a release?
57+
### How do I fix the repo if all the packages were published, but the CI Failed to update the [github releases page](https://github.com/segmentio/analytics-next/releases)?
58+
```bash
59+
# checkout master so the HEAD is pointing to the "Version Packages" PR
60+
git co master && git pull --ff-only
6061

62+
# Reads from the current tags and create github releases
63+
export GITHUB_TOKEN="???"
64+
yarn scripts create-release-from-tags
65+
```
66+
67+
68+
### I don't want to use automation, how do I manually create a release?
6169
```bash
6270
export GITHUB_TOKEN="???" ## changelog generator requirement (https://github.com/settings/tokens)
6371

0 commit comments

Comments
 (0)