Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/autoflow/__tests__/policy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Deno.test('release: local plan includes publish, smoke, gates, and GitHub releas
assert(commands.some(([name]) => name === 'run release gates after bump'));
assert(commands.some(([name]) => name === 'package artifact gate'));
assert(commands.some(([name]) => name === 'push dev'));
assert(commands.some(([name]) => name === 'sync dev to main'));
assert(commands.some(([name]) => name === 'sync main from dev (fast-forward)'));
assert(
commands.some(([, command]) => command.includes('deno task publish:npm')),
);
Expand Down
32 changes: 13 additions & 19 deletions tools/autoflow/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ export function createReleasePlan(
},
{
name: 'push tag',
command: ['git', 'push', '--force', 'origin', tag],
// No force-push: a tag that already exists at a different commit is left
// untouched (the local `git tag -f` above is guarded and only runs when
// the existing tag points at a different commit, with a warning).
command: ['git', 'push', 'origin', tag],
},
...(canCreateGitHubRelease()
? [
Expand Down Expand Up @@ -278,7 +281,10 @@ export function createReleasePlan(
];
}

// Local/manual release: work on dev, then fast-forward main from dev.
// Local/manual release: bump on dev, fast-forward main from dev in a single
// transition, then keep dev in sync with main. This removes the redundant
// pull/push round-trips that previously bounced between dev and main and
// reduces the chance of a half-released state.
return [
...baseSteps,
{
Expand All @@ -294,21 +300,9 @@ export function createReleasePlan(
command: ['git', 'checkout', 'main'],
},
{
name: 'refresh main',
command: ['git', 'pull', '--ff-only', 'origin', 'main'],
},
{
name: 'sync dev to main',
name: 'sync main from dev (fast-forward)',
command: ['git', 'merge', '--ff-only', 'dev'],
},
{
name: 'pull main (before publish)',
command: ['git', 'pull', '--rebase', 'origin', 'main'],
},
{
name: 'push main (before publish)',
command: ['git', 'push', 'origin', 'main'],
},
...publishSteps,
{
name: 'deploy:pages',
Expand All @@ -320,22 +314,22 @@ export function createReleasePlan(
},
...evidenceSteps,
{
name: 'push main evidence',
name: 'push main (release + evidence)',
command: ['git', 'push', 'origin', 'main'],
},
...tagSteps,
{
name: 'checkout dev',
command: ['git', 'checkout', 'dev'],
},
{
name: 'sync main evidence to dev',
name: 'sync dev from main (fast-forward)',
command: ['git', 'merge', '--ff-only', 'main'],
},
{
name: 'push dev evidence',
name: 'push dev',
command: ['git', 'push', 'origin', 'dev'],
},
...tagSteps,
];
}

Expand Down
Loading