← 输入框|github.com|刷新
Skip to content

ci: release with release-please and deprecate every npm version - #472

Merged
luwes merged 4 commits into
masterfrom
chore/release-workflow
Oct 9, 2026
Merged

luwes merged 4 commits into
masterfrom
chore/release-workflow

Conversation

@luwes

@luwes luwes commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Adds an automated release flow, modeled on Plyr's, that publishes Video-React security releases and deprecates the package on npm the way Plyr is deprecated.

How it works

  1. Release PR: on each push to master, release-please keeps a chore(release): X.Y.Z PR up to date with the version bump and CHANGELOG.md entries. Nothing is published until a maintainer merges it.

  2. Publish: merging that PR creates the tag and GitHub release. The publish job then runs lint, tests and the build, and publishes with npm trusted publishing and provenance, so no long-lived token is needed. The job runs in a Production environment.

  3. Deprecate: it runs npm deprecate "video-react@*" with:

    Video-React is deprecated and receives security fixes only. Use Video.js 10 for new projects. Migration guide: https://videojs.org/docs/framework/react/guides/migrate-from-video-react

    Trusted publishing can't run npm deprecate, so this step uses an NPM_TOKEN secret. Only the deprecate step gets the token, so it can't replace trusted publishing for the publish itself. The step reruns on every release, because an earlier deprecation doesn't cover a new version. If the secret isn't set, the release still publishes and the job summary prints the command to run by hand. That matches what Plyr did: its workflow has no deprecate step, and 3.8.5 was deprecated about 8 minutes after it was published.

Config

  • Files: .github/release-please/ holds the config, plus a manifest starting at 0.16.0.
  • Tags: stay in this repo's existing format (0.16.1, no v).
  • Changelog start: bootstrap-sha points at the 0.16.0 release commit. The 0.16.0 tag was never pushed, so release-please couldn't find it otherwise.
  • Version bumps: bump-minor-pre-major makes a breaking change bump the minor version instead of jumping to 1.0.0.

Also in this PR

  • Old release flow removed: scripts/release and scripts/publish (which still referenced Travis), their npm scripts, and the conventional-changelog dev dependencies only they used.
  • CONTRIBUTION.md: the Releasing section now covers the new flow and its setup.
  • npm homepage: set to https://video-react.js.org, in a separate commit.

Setup before the first release (needs an npm owner)

  1. npm trusted publisher: on npmjs.com, add a GitHub Actions trusted publisher for video-react/video-react, workflow release.yml, environment Production. It must publish successfully within 2 days, so add it shortly before merging the first release PR.
  2. NPM_TOKEN secret (optional): a granular npm token with write access to video-react that can bypass 2FA. Without it, an owner runs the printed npm deprecate command after each release.
  3. Approval (optional): add required reviewers to the Production environment.

Once this merges, the workflow opens the first release PR straight away. It doesn't publish anything until that PR is merged.

Verification

  • actionlint: passes on all workflows.
  • release-please dry run: run against a temporary branch of this repo (since deleted). It would open chore(release): 0.16.1, listing the fix: test, build, dep issues #459 fix plus the recent docs commits, and bump package.json and package-lock.json.
  • Clean npm ci, npm run lint, npm test (99/99), npm run build: all pass.
  • npm pack --dry-run: scripts/ is no longer in the tarball.

luwes added 2 commits October 9, 2026 13:26
Merging the release-please PR tags the release, then publishes to npm with trusted publishing and provenance and runs npm deprecate on every version with a pointer to the migration guide, as Plyr did. Replaces the manual scripts/release and scripts/publish flow and its conventional-changelog dependencies.
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Thank you for this pull request, and for the time you've put into Video-React.

Video-React is now in security-only maintenance. Until January 2028, we'll merge priority security fixes and nothing else, so we're closing pull requests that don't fix a security issue, and this one won't be merged.

Mux, which maintains Video-React, now works on Video.js 10 together with the teams behind Video.js, Vidstack, Plyr, and Media Chrome. If this change applies there, we'd love a pull request or issue in videojs/v10. To move a Video-React integration, follow the Migrate from Video-React guide.

Migrating with a coding agent? Paste the prompt from the guide's AI Quickstart section into your agent.

If this fixes a security vulnerability, comment here and we'll review it. For a vulnerability that isn't public yet, follow SECURITY.md instead.

@github-actions github-actions Bot closed this Oct 9, 2026
@luwes luwes reopened this Oct 9, 2026
luwes added 2 commits October 9, 2026 13:29
Addresses SonarCloud findings: pin the action to a commit SHA, and install an exact npm version without lifecycle scripts in the job that can publish.
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@luwes
luwes merged commit e9022f0 into master Oct 9, 2026
7 checks passed
@luwes
luwes deleted the chore/release-workflow branch October 9, 2026 20:33
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.

1 participant