Publish a lock file as part of GH releases
See original GitHub issueReasoning:
- lock files are useful for reproducible builds and debugging
- some people find lock files annoying, esp. when maintaining libraries
To get the best of both worlds, it would be nice to keep a lock file, but not make it a part of the repo nor a part of the npm published package.
So I’d suggest:
- when creating a GH release
- if there is a package-lock.json or an npm-shrinkwrap.json (or a yarn.lock?) - back it up
- create an npm-shrinkwrap.json (incl. dev deps) and include as an artifact
- restore the previous lock file (or delete, if none existed), so that other plugins are unaffected
I think it would be a good default, with an opt-out, but opt-in is probably also better than nothing. Not sure if there’s a way to have this as a recipe (if there is reluctance to have it built in)? Maybe create it in postpack
?
Happy to PR, if an approach can be agreed.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Github actions: Dependencies lock file is not found in runners ...
It seems it broke because the setup step ( Use Node.js ${{ matrix.node-version }} ) looked for those files at the repository root....
Read more >gh-release | Yarn - Package Manager
Uses the Github Releases API to create a new GitHub release. Defaults to using information from package.json and CHANGELOG.md . Supports uploading release...
Read more >File Locking - GitLab Documentation
When a file or directory is unlocked, the user is said to have “released the lock”. GitLab supports two different modes of file...
Read more >Yarn | Code Cookbook - Michael Currin - GitHub Pages
This section covers how to set up one or more target versions of Node and Yarn and ... name: Install dependencies run: yarn...
Read more >Release process - Pants build
Add the new file to pants.toml in the release_notes section. 0b. dev ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the thorough explanations @dominykas!
I think your use case is not common enough to implement it as default behaviour in semantic-release. You can however achieve that with the current plugins:
@semantic-release/exec
to generate yournpm-shrinkwrap.json
and move it in a temp folderassets
option of@semantic-release/github
to add it to the GH releaseThanks, I understand. I was thinking of a wider application for reproducible build tooling, but I guess we’ll have to wait and see.
I’m also reluctant to tinker with
plugins
defaults (not sure why, just doesn’t feel comfortable, maybe cause so much of default functionality depends on that), but I haven’t looked at shared configs, so maybe there’s scope for easy setup that way.