Skip to content

Commit

Permalink
feat(release): allow automated git push from version or changelog step
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed Dec 10, 2024
1 parent d2564c6 commit 5aff8e2
Show file tree
Hide file tree
Showing 12 changed files with 453 additions and 99 deletions.
5 changes: 4 additions & 1 deletion docs/generated/cli/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ nx release version [specifier]
| `--git-commit` | boolean | Whether or not to automatically commit the changes made by this command. |
| `--git-commit-args` | string | Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes. |
| `--git-commit-message` | string | Custom git commit message to use when committing the changes made by this command. {version} will be dynamically interpolated when performing fixed releases, interpolated tags will be appended to the commit body when performing independent releases. |
| `--git-push` | boolean | Whether or not to automatically push the changes made by this command to the remote git repository. |
| `--git-remote` | string | Alternate git remote to push commits and tags to (can be useful for testing). (Default: `origin`) |
| `--git-tag` | boolean | Whether or not to automatically tag the changes made by this command. |
| `--git-tag-args` | string | Additional arguments to pass to the `git tag` command invoked behind the scenes. |
| `--git-tag-message` | string | Custom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself. |
Expand All @@ -90,7 +92,8 @@ nx release changelog [version]
| `--git-commit` | boolean | Whether or not to automatically commit the changes made by this command. |
| `--git-commit-args` | string | Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes. |
| `--git-commit-message` | string | Custom git commit message to use when committing the changes made by this command. {version} will be dynamically interpolated when performing fixed releases, interpolated tags will be appended to the commit body when performing independent releases. |
| `--git-remote` | string | Alternate git remote in the form {user}/{repo} on which to create the Github release (useful for testing). (Default: `origin`) |
| `--git-push` | boolean | Whether or not to automatically push the changes made by this command to the remote git repository. |
| `--git-remote` | string | Alternate git remote to push commits and tags to (can be useful for testing). (Default: `origin`) |
| `--git-tag` | boolean | Whether or not to automatically tag the changes made by this command. |
| `--git-tag-args` | string | Additional arguments to pass to the `git tag` command invoked behind the scenes. |
| `--git-tag-message` | string | Custom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself. |
Expand Down
5 changes: 4 additions & 1 deletion docs/generated/packages/nx/documents/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ nx release version [specifier]
| `--git-commit` | boolean | Whether or not to automatically commit the changes made by this command. |
| `--git-commit-args` | string | Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes. |
| `--git-commit-message` | string | Custom git commit message to use when committing the changes made by this command. {version} will be dynamically interpolated when performing fixed releases, interpolated tags will be appended to the commit body when performing independent releases. |
| `--git-push` | boolean | Whether or not to automatically push the changes made by this command to the remote git repository. |
| `--git-remote` | string | Alternate git remote to push commits and tags to (can be useful for testing). (Default: `origin`) |
| `--git-tag` | boolean | Whether or not to automatically tag the changes made by this command. |
| `--git-tag-args` | string | Additional arguments to pass to the `git tag` command invoked behind the scenes. |
| `--git-tag-message` | string | Custom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself. |
Expand All @@ -90,7 +92,8 @@ nx release changelog [version]
| `--git-commit` | boolean | Whether or not to automatically commit the changes made by this command. |
| `--git-commit-args` | string | Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes. |
| `--git-commit-message` | string | Custom git commit message to use when committing the changes made by this command. {version} will be dynamically interpolated when performing fixed releases, interpolated tags will be appended to the commit body when performing independent releases. |
| `--git-remote` | string | Alternate git remote in the form {user}/{repo} on which to create the Github release (useful for testing). (Default: `origin`) |
| `--git-push` | boolean | Whether or not to automatically push the changes made by this command to the remote git repository. |
| `--git-remote` | string | Alternate git remote to push commits and tags to (can be useful for testing). (Default: `origin`) |
| `--git-tag` | boolean | Whether or not to automatically tag the changes made by this command. |
| `--git-tag-args` | string | Additional arguments to pass to the `git tag` command invoked behind the scenes. |
| `--git-tag-message` | string | Custom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself. |
Expand Down
6 changes: 4 additions & 2 deletions e2e/release/src/create-github-release.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ describe('nx release create github release', () => {
const result = runCLI('release patch -d --first-release --verbose');

expect(
result.match(new RegExp(`NX Pushing to git remote`, 'g')).length
result.match(new RegExp(`NX Pushing to git remote "origin"`, 'g'))
.length
).toEqual(1);
expect(
result.match(new RegExp(`NX Creating GitHub Release`, 'g')).length
Expand Down Expand Up @@ -148,7 +149,8 @@ describe('nx release create github release', () => {
const result = runCLI('release -d --first-release --verbose');

expect(
result.match(new RegExp(`NX Pushing to git remote`, 'g')).length
result.match(new RegExp(`NX Pushing to git remote "origin"`, 'g'))
.length
).toEqual(1);
expect(
result.match(new RegExp(`NX Creating GitHub Release`, 'g')).length
Expand Down
2 changes: 1 addition & 1 deletion e2e/release/src/release.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ describe('nx release', () => {
NX Tagging commit with git
NX Pushing to git remote
NX Pushing to git remote "origin"
NX Creating GitHub Release
Expand Down
Loading

0 comments on commit 5aff8e2

Please sign in to comment.