ably-js icon indicating copy to clipboard operation
ably-js copied to clipboard

chore: add auto-release script

Open AndyTWF opened this issue 5 months ago • 1 comments

This change introduces an auto release script for actions, the same as we run for chat-js. It runs automatically upon release creation and publishes with provenance to npm. Similarly, the CDN publish script has been updated to invoke automatically.

This allows us to release automatically when new versions are tagged, including with provenance which provides guarantees as to the authenticity of the package.

Summary by CodeRabbit

  • Chores

    • Automated publishing to npm and CDN now triggers on release publication, improving reliability and reducing manual steps.
    • Versioning derives from the release tag, eliminating manual input and aligning artifacts with releases.
  • Documentation

    • Updated contributing guide to reflect the new automated release process, including simplified steps, post-release verification, and changelog update guidance.

AndyTWF avatar Sep 18 '25 20:09 AndyTWF

Walkthrough

The CDN workflow now triggers on release publication and passes tag info via github.ref_name. A new release workflow publishes npm packages on release. CONTRIBUTING.md updates the release process to reflect automated publishing and verification via GitHub Actions.

Changes

Cohort / File(s) Change Summary
CI/CD workflows
.github/workflows/publish-cdn.yml, .github/workflows/release.yml
CDN: switch trigger to release(published); use github.ref/github.ref_name for ref/tag; keep other steps. New: add release.yml to publish to npm on release with Node 20.10.0, npm registry auth via NPM_TOKEN, build and npm publish --provenance --access public.
Documentation
CONTRIBUTING.md
Rewrite release process: remove manual build/tag/publish; create GitHub release from tag; verify Release and CDN workflows; retain post-release changelog update.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Maintainer
  participant GitHub as GitHub Releases
  participant ReleaseWF as Release Workflow (npm)
  participant CDNWF as CDN Workflow
  participant npm as npm Registry
  participant CDN as CDN Provider

  Maintainer->>GitHub: Publish Release (tagged)
  Note right of GitHub: Event: release (published)

  GitHub-->>ReleaseWF: Trigger
  GitHub-->>CDNWF: Trigger

  rect rgba(205, 232, 255, 0.3)
    note over ReleaseWF: Uses github.ref / ref_name
    ReleaseWF->>ReleaseWF: Checkout, setup Node, npm ci, build
    ReleaseWF->>npm: npm publish (provenance, public)
    npm-->>ReleaseWF: Publish result
  end

  rect rgba(217, 255, 205, 0.3)
    note over CDNWF: Uses github.ref_name as tag
    CDNWF->>CDN: Deploy assets for tag
    CDN-->>CDNWF: Deployment result
  end

  ReleaseWF-->>GitHub: Status (success/failure)
  CDNWF-->>GitHub: Status (success/failure)
  GitHub-->>Maintainer: Check workflow completions

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws: a tag appears!
The pipelines hop without our fears.
npm burrows, CDN takes flight—
Carrots cached, the bytes just right.
With whiskered checks and releases clean,
We bound through fields of evergreen.
Ship it, squeak it—slick and lean!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "chore: add auto-release script" is concise, follows a conventional prefix, and accurately reflects the primary change in the PR (adding automated release workflows and related automation changes), so it communicates the main intent to reviewers scanning history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment
  • [ ] Commit unit tests in branch auto-release-script

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Sep 18 '25 20:09 coderabbitai[bot]