Skip to content

Replace fragile local release script with GitHub Actions workflow trigger #116

@jirispilka

Description

@jirispilka

Problem

The current release process relies on scripts/publish.sh, a local shell script that performs ~15 steps locally (npm auth, gh auth, lint, build, E2E tests, version bump, changelog update, git commit/tag/push, npm publish, GitHub release creation). This is fragile because:

  • Partial failure state: If any step after npm publish fails, the package is published to npm but the GitHub release is missing — exactly what happened with v0.2.0 (the gh release create command had an invalid --target flag, fixed in Fix release action: remove invalid --target flag #114, but npm was already published)
  • Local environment dependency: Depends on local npm credentials, gh CLI auth, Node.js version, etc.
  • Interactive prompts: Prompts for untracked files, making it unsuitable for scripting
  • Redundancy: The release.yml GitHub Actions workflow already handles all of this properly

Current state

  • v0.2.0 was released via release.yml but the GitHub release was never created (the workflow failed on gh release create due to the --target bug)
  • release.yml was fixed in Fix release action: remove invalid --target flag #114 but scripts/publish.sh still exists as a parallel, fragile path
  • npm run release still calls the local script

Proposed changes

1. Replace scripts/publish.sh with a GitHub Actions trigger

Replace the local script with a thin wrapper that:

  • Validates pre-conditions (clean working directory, on main branch, up-to-date)
  • Triggers the release.yml workflow via gh workflow run
  • Opens the workflow run URL in the browser so the user can monitor progress

This keeps the npm run release convenience but delegates all actual work to CI.

2. Harden release.yml

  • Add concurrency protection (group: release, cancel-in-progress: false) to prevent concurrent releases
  • Replace gh release create CLI with softprops/action-gh-release@v2 (more reliable, used successfully in apify-mcp-server)

3. Update documentation

  • Update CLAUDE.md releasing section to reflect the new process
  • Update package.json scripts

4. Create missing v0.2.0 GitHub release

Once the process is fixed, create the missing GitHub release for the v0.2.0 tag.

References

  • apify-mcp-server's working release workflow: manual_release_stable.yaml (GitHub Actions only, no local script, uses softprops/action-gh-release@v2, has concurrency protection)
  • Fix release action: remove invalid --target flag #114 — fixed the immediate --target flag bug but didn't address the underlying fragility

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions