Skip to content

Conversation

@monadoid
Copy link
Contributor

@monadoid monadoid commented Dec 23, 2025

why

Changesets requires waiting for release PRs and we want to push new stagehand-server versions more frequently

what changed

No longer using changesets - manually bumping package.json version number

test plan


Summary by cubic

Switched stagehand-server releases from Changesets to a dedicated workflow that publishes on manual version bumps. This speeds up releases and automates tagging, binaries, and GitHub Releases.

  • Refactors

    • Added .github/workflows/stagehand-server-release.yml to detect version bumps, tag stagehand-server/vX.Y.Z, and publish a GitHub Release.
    • Builds SEA binaries for Linux, macOS, and Windows (x64/arm64), and uploads the OpenAPI spec and SHA256 checksums.
    • Removed server release logic from .github/workflows/release.yml; canary publish remains.
    • Bumped @browserbasehq/stagehand-server to 3.1.1.
  • Migration

    • To release: bump packages/server/package.json and merge to main (or trigger the workflow manually).

Written for commit 21f2cc3. Summary will update automatically on new commits.

@changeset-bot
Copy link

changeset-bot bot commented Dec 23, 2025

⚠️ No Changeset found

Latest commit: 21f2cc3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 23, 2025

Greptile Summary

This PR migrates stagehand-server away from the changesets release system to manual version management. The server release logic has been extracted from the main release.yml workflow into a dedicated stagehand-server-release.yml workflow that triggers automatically on packages/server/package.json version changes, enabling faster, more frequent releases without waiting for changesets PR approvals.

  • Workflow restructuring: Removed ~235 lines of server-specific logic from main release workflow
  • Dedicated server workflow: New stagehand-server-release.yml handles version detection, tagging, binary building (6 platform variants), and GitHub release publishing
  • Version bump: Server version bumped to 3.1.1 to initiate first release under new system
  • Clean separation: Main release workflow now focuses solely on core SDK releases via changesets
  • No breaking changes: All downstream integrations intact, proper output variable cleanup

Confidence Score: 5/5

  • This PR is safe to merge with high confidence. The refactoring cleanly separates concerns without introducing any functional regressions.
  • The PR demonstrates a well-planned architectural improvement: (1) Server release logic is properly isolated into its own workflow with clear trigger conditions (path-based on package.json), (2) All server release responsibilities are preserved in the new workflow with identical logic, (3) No breaking changes to existing integrations - the main release workflow continues operating normally for SDK releases, (4) Clean removal of unused outputs ensures no downstream breakage, (5) Version bump is reasonable and initiates the new release system. The changes are low-risk and high-benefit for release velocity.
  • No files require special attention. All changes are straightforward and well-structured.

Important Files Changed

Filename Overview
.github/workflows/release.yml Removed stagehand-server release logic (tagging, binary building, publishing) from main release workflow. These responsibilities are now handled by the dedicated stagehand-server-release.yml workflow triggered on packages/server/package.json changes. The main release workflow continues to handle core SDK releases via changesets and canary releases.
.github/workflows/stagehand-server-release.yml New dedicated workflow for stagehand-server releases. Detects version bumps in packages/server/package.json and automatically builds binaries for all platforms (Linux x64/arm64, macOS x64/arm64, Windows x64/arm64), creates git tags, and publishes GitHub releases with artifacts. Workflow structure is clean with good separation of concerns and proper concurrency controls.
packages/server/package.json Version bumped from 3.0.6 to 3.1.1. Simple version change to initiate the first release under the new manual versioning system (no longer using changesets for server releases).

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Git as Git/GitHub
    participant MainWF as release.yml
    participant ServerWF as stagehand-server-release.yml
    
    rect rgb(200, 220, 255)
    Note over Dev,ServerWF: SDK Release (existing flow)
    Dev->>Git: Push changesets to main
    Git->>MainWF: Trigger on push to main
    MainWF->>MainWF: Create Release PR or Publish
    MainWF->>Git: Publish SDK to npm
    MainWF->>Git: Publish canary build
    end
    
    rect rgb(220, 255, 220)
    Note over Dev,ServerWF: Server Release (NEW flow)
    Dev->>Git: Bump version in packages/server/package.json
    Git->>ServerWF: Trigger on path change
    ServerWF->>ServerWF: Detect version bump
    ServerWF->>ServerWF: Build binaries (6 platforms)
    ServerWF->>Git: Create git tag
    ServerWF->>Git: Publish GitHub Release w/ binaries
    end
    
    Note over MainWF,ServerWF: Workflows are now independent and parallel
Loading

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name=".github/workflows/stagehand-server-release.yml">

<violation number="1" location=".github/workflows/stagehand-server-release.yml:9">
P2: Manual `workflow_dispatch` triggers will never create releases because `github.event.before` is only available for `push` events. When triggered manually, `BEFORE_SHA` will be empty, causing `before_version` to be empty, and the release condition `[ -n &quot;${before_version}&quot; ]` will always fail. Consider adding fallback logic for manual triggers, such as checking if the tag already exists or adding a workflow input to force release.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

- main
paths:
- packages/server/package.json
workflow_dispatch:
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Manual workflow_dispatch triggers will never create releases because github.event.before is only available for push events. When triggered manually, BEFORE_SHA will be empty, causing before_version to be empty, and the release condition [ -n "${before_version}" ] will always fail. Consider adding fallback logic for manual triggers, such as checking if the tag already exists or adding a workflow input to force release.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/stagehand-server-release.yml, line 9:

<comment>Manual `workflow_dispatch` triggers will never create releases because `github.event.before` is only available for `push` events. When triggered manually, `BEFORE_SHA` will be empty, causing `before_version` to be empty, and the release condition `[ -n &quot;${before_version}&quot; ]` will always fail. Consider adding fallback logic for manual triggers, such as checking if the tag already exists or adding a workflow input to force release.</comment>

<file context>
@@ -0,0 +1,313 @@
+      - main
+    paths:
+      - packages/server/package.json
+  workflow_dispatch:
+
+permissions:
</file context>

✅ Addressed in 21f2cc3

…sion to the latest existing stagehand-server tag
@monadoid monadoid merged commit 87eac33 into main Dec 23, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants