|
1 | | -We automatically push tags to Rubygems via CI. |
| 1 | +Releasing |
| 2 | +========= |
2 | 3 |
|
3 | | -Release |
4 | | -============ |
| 4 | +Publishing happens in CI through RubyGems Trusted Publishing (OIDC). No API key is |
| 5 | +stored anywhere — `deploy.yml` exchanges the GitHub OIDC token for a push-scoped |
| 6 | +RubyGems key that expires in 15 minutes. |
5 | 7 |
|
6 | | -- Make sure you're on the latest `master` |
7 | | -- Bump the version in [`version.rb`](lib/segment/analytics/version.rb) |
8 | | -- Update [`History.md`](History.md) |
9 | | -- Commit these changes. `git commit -am "Release x.y.z."` |
10 | | -- Tag the release. `git tag -a -m "Version x.y.z" x.y.z` |
11 | | -- `git push -u origin master && git push --tags |
12 | | -- Run the publish action on Github |
| 8 | +1. Bump `VERSION` in [`lib/segment/analytics/version.rb`](lib/segment/analytics/version.rb). |
| 9 | +2. In [`History.md`](History.md), change the `Unreleased` heading to `X.Y.Z / YYYY-MM-DD`. |
| 10 | +3. `git commit -am "Release X.Y.Z."` |
| 11 | +4. Open a PR and merge it to `master`. |
| 12 | +5. Tag the merged commit — no `v` prefix: |
13 | 13 |
|
| 14 | + ``` |
| 15 | + git tag X.Y.Z && git push origin X.Y.Z |
| 16 | + ``` |
| 17 | + |
| 18 | +6. Create a **GitHub Release** for that tag. `deploy.yml` triggers on |
| 19 | + `release: published`; pushing the tag by itself does not start it. |
| 20 | +7. Approve the `production` environment when the publish job requests review. |
| 21 | + |
| 22 | +The workflow verifies the tag against `version.rb`, builds the gem, and pushes it. |
| 23 | + |
| 24 | +> **Note:** the trusted publisher on rubygems.org is registered against repository |
| 25 | +> `segmentio/analytics-ruby`, workflow `deploy.yml` and environment `production`. All |
| 26 | +> three must match the workflow or the OIDC exchange fails. |
0 commit comments