-
Notifications
You must be signed in to change notification settings - Fork 617
Add build-npm
script
#329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add build-npm
script
#329
Conversation
Hello @bexnoss. Thank you for your pull request. Can we use |
Hello @dmitry-shibanov, I'll also change |
I have removed the documentation from the README and instead put it into the commit message. This way determined users can still find it but it isn't advertised as an intended use case. The goals of this PR are to add a "correct" way of building @actions/setup-python as a NPM dependency so users don't have to experiment with various hacks and also to future proof this, so if the build process gets changed again the "build-npm" script can stay unchanged and keep working for this use case. Please let me know if there is anything else that can be improved. |
Hello @bexnoss. Sorry for the late response. Could you please sync with the main branch ? |
This script can be used to build @actions/setup-python when it was installed as a dependency in another action. Add dependency: `npm install actions/setup-python#v2` Automatically build on install: ``` "scripts": { "postinstall": "npm run build-npm --prefix node_modules/setup-python" } ``` Install depending action as usual: `npm ci` or `npm install` No further steps necessary, @actions/setup-python is built automatically in the "postinstall" step of installation.
Hello @dmitry-shibanov, no problem. I have synced with the main branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @bexnoss. I don't think publishing as an NPM package is the direction we want to go in. I'll comment on the issue, but I think composite actions is the right approach to reusability here.
Hello everyone. For now I'm going to close the pull request because as mentioned the composite action should help. |
Description:
Adds a
build-npm
script and documents it. This basically implements the workaround from #38 (comment) with added declaration files as a npm script.The
build-npm
script does the following things:npm install
since in this use case the project is installed in node_modules it is necessary to install firstnode -e "require('fs').rmSync('lib', { recursive: true, force: true })"
isrm -rf lib
in Node. This is necessary because tsc thinks the generated declaration files in lib are source files and refuses to overwrite them.tsc --declaration --declarationMap
builds the project with declarations into libRelated issue:
#38
Check list: