feat: publish to npm#159
Conversation
cc2d90e to
bff6f70
Compare
bff6f70 to
43df26d
Compare
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/checkout@v4 |
There was a problem hiding this comment.
Bumping this for consistency.
| homebrew-gh-secret: ${{secrets.HOMEBREW_DEPLOY_KEY}} | ||
| tag: ${{ inputs.tag }} | ||
|
|
||
| release-ldcli-npm: |
There was a problem hiding this comment.
This should be the same as what's in the release-please action.
| fetch-depth: 0 | ||
| - uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 20.x |
There was a problem hiding this comment.
Bumped to 20.x because of npm warning.
| @@ -0,0 +1,13 @@ | |||
| nodeLinker: node-modules | |||
There was a problem hiding this comment.
I don't know what anything in this directory and the .yarn directory does. I copied these from the js-core repo.
dbolson
left a comment
There was a problem hiding this comment.
@kinyoklion I don't have a good understanding of what's going on in here. I pattern-matched much of the code from the js-core repo and kept tweaking it until it worked. Would you, or someone else you suggest, have time to review this and maybe talk through what's going on and if we could simplify it?
I think that we could simplify things. The js-core repo publishes 15 packages for several ecosystems, so there is more going on than is strictly needed. Though there can be some benefits from consistency. I would be happy to talk through things, but I probably wouldn't be able to do that until Monday. |
| { | ||
| "name": "@launchdarkly/ldcli", | ||
| "description": "The official command line interface for managing LaunchDarkly feature flags.", | ||
| "version": "0.0.1", |
There was a problem hiding this comment.
This gets overwritten similar to the go version variable.
| @@ -0,0 +1,9 @@ | |||
| cmd/ | |||
There was a problem hiding this comment.
We don't need to include these files in the npm package.
| "bootstrap-sha": "f37bd3aee1f117faba005bf96f0d0888f898ee41", | ||
| "prerelease": true | ||
| "prerelease": true, | ||
| "extra-files": [ |
There was a problem hiding this comment.
This bumps the package-json version that npm needs.
| run: | | ||
| ./scripts/publish-npm.sh | ||
| env: | ||
| LD_RELEASE_IS_PRERELEASE: ${{ inputs.prerelease }} |
There was a problem hiding this comment.
What changes when LD_RELEASE_IS_PRERELEASE is set to true?
There was a problem hiding this comment.
It would be for tagging the npm package so we don't bump the normal version. We probably won't need to use it.
There was a problem hiding this comment.
If you were going to be doing beta/alpha versions, then it would potentially be something you would want. (Or even nightlies 0.7.0-nightly-somesha).
Depending on how you are going to manage releases it may not be relevant.
| else | ||
| if $LD_RELEASE_IS_PRERELEASE ; then | ||
| echo "Publishing with prerelease tag." | ||
| npm publish --tag prerelease --provenance --access public || { echo "npm publish failed" >&2; exit 1; } |
There was a problem hiding this comment.
Thanks for adding the --provenance flag!
Set up npm to publish package that wraps binary.
I've tested this with the manual release workflow, but we'll need to test it once it's merged.
Requirements
Related issues
Provide links to any issues in this repository or elsewhere relating to this pull request.
Describe the solution you've provided
Provide a clear and concise description of what you expect to happen.
Describe alternatives you've considered
Provide a clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context about the pull request here.