Commit 5c5383f
Automate package.json version bumping in release workflow (#190)
## Summary
Updated the NPM publish workflow to automatically bump the version in
`package.json` when a release is created, ensuring the published package
version matches the git release tag.
## Key Changes
- Updated permissions to allow writing to repository contents (required
for pushing commits)
- Removed outdated workflow comments
- Added automated version bumping step that extracts version from
release tag and updates `package.json`
- Added commit and push step to persist version changes back to the main
branch using GitHub Actions bot credentials
- Version bump occurs before the build and publish steps to ensure
consistency
## Implementation Details
- Version is extracted from `github.event.release.tag_name` and the `v`
prefix is stripped before applying to npm version command
- Uses `npm version` with `--no-git-tag-version` flag to update version
without creating duplicate git tags
- Commits both `package.json` and `package-lock.json` to maintain
lockfile consistency
- Pushes changes directly to main branch after release creation
https://claude.ai/code/session_01CAvVi3i1zrJrf1B7KsRj8o
Co-authored-by: Claude <noreply@anthropic.com>1 parent 0832959 commit 5c5383f
1 file changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | 1 | | |
5 | 2 | | |
6 | 3 | | |
| |||
9 | 6 | | |
10 | 7 | | |
11 | 8 | | |
12 | | - | |
| 9 | + | |
13 | 10 | | |
14 | 11 | | |
15 | 12 | | |
| |||
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
26 | 34 | | |
27 | 35 | | |
0 commit comments