Assets: publish to npm when a release is published - #1305
Conversation
The npm package only ever goes out by hand through workflow_dispatch, and then only as a 0.0.0-<date>-<hash> snapshot under the master tag. Tagging a release publishes nothing, so npm latest still points at 7.1.0 from August while composer is at v7.2.0. Anyone taking the assets from npm is missing every fix since, the autosubmit ones among them - and the filter form now carries data-naja-unique from the template while the JS half of that fix is unavailable. Publishing now also runs on a published release, taking the version from the tag and going out under latest.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1305 +/- ##
=======================================
Coverage 49.12% 49.12%
=======================================
Files 63 63
Lines 2974 2974
=======================================
Hits 1461 1461
Misses 1513 1513 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub Actions assets workflow so that the npm package is automatically published when a GitHub Release is published, using the release tag version and publishing under npm’s default latest tag (instead of only manual workflow_dispatch snapshot publishes under the master tag).
Changes:
- Add a
releasetrigger (types: ["published"]) to the assets workflow. - Introduce a
publish-releasejob that sets the npm package version from the release tag and publishes to npm (defaultlatesttag).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Thanks for this — the premise checks out. npm The mechanics look right to me: One thing I'd like changed before merging: My preference is to keep publishing them, just under a separate tag: - run: npm publish --provenance --access public --tag ${{ github.event.release.prerelease && 'next' || 'latest' }}That way betas stay installable via if: github.event_name == 'release' && github.event.release.prerelease == falseEither is fine by me — happy to merge once one of them is in. |
The npm package only ever goes out by hand through workflow_dispatch, and then only as a 0.0.0-- snapshot under the master tag. Tagging a release publishes nothing, so npm latest still points at 7.1.0 from August while composer is at v7.2.0. Anyone taking the assets from npm is missing every fix since, the autosubmit ones among them - and the filter form now carries data-naja-unique from the template while the JS half of that fix is unavailable.
Publishing now also runs on a published release, taking the version from the tag and going out under latest.