Make src-cli installable via npm.#760
Conversation
c199de1 to
19a79e4
Compare
| 2. Find the latest version (either via the releases tab on GitHub or via git tags) to determine which version you are releasing. | ||
| 3. `VERSION=9.9.9 ./release.sh` (replace `9.9.9` with the version you are releasing) | ||
| 4. GitHub will automatically perform the release via the [goreleaser action](https://github.com/sourcegraph/src-cli/actions?query=workflow%3AGoreleaser). Once it has finished, **you need to confirm**: | ||
| 3. Update the `"version"` field in the file `npm-distribution/package.json` to match the version you are releasing. |
There was a problem hiding this comment.
Can the release script automate that?
There was a problem hiding this comment.
Is it OK if the release step runs git push origin main? I already updated the release script to validate that the version in package.json matches but didn't feel comfortable pushing a commit to main without review/test-plan.
There was a problem hiding this comment.
Given that we need to merge the changelog entries anwyays, i think it's OK to require a PR before running VERSION=X ./release.sh
There was a problem hiding this comment.
I'm happy to follow up on this after merge. Gonna try to cut a new release to see it go live on npm
| GITHUB_TOKEN: ${{ secrets.GH_PAT }} | ||
|
|
||
| npm: | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
Should this depend on the goreleaser step? Otherwise there will be a short moment in which it doesn’t work.
There was a problem hiding this comment.
Good point. I updated the flow to depend on the goreleaser job.
Fixes #759. Previously, the recommended way to install src-cli on Linux was to download a static binary via `curl`. This PR makes it possible to install src-cli via `npm install -g @sourcegraph/src`. The new npm distribution will be particuarly helpful for users of our new scip-typescript and scip-python indexers that are also distributed via npm.
19a79e4 to
1e1f613
Compare
|
Woho, seems to have worked! Re the additional manual step: It has |
* Make src-cli installable via npm. Fixes #759. Previously, the recommended way to install src-cli on Linux was to download a static binary via `curl`. This PR makes it possible to install src-cli via `npm install -g @sourcegraph/src`. The new npm distribution will be particuarly helpful for users of our new scip-typescript and scip-python indexers that are also distributed via npm. * Make the npm release flow depend on goreleaser

Fixes #759. Previously, the recommended way to install src-cli on Linux
was to download a static binary via
curl. This PR makes it possible toinstall src-cli via
npm install -g @sourcegraph/src. The new npmdistribution will be particuarly helpful for users of our new
scip-typescript and scip-python indexers that are also distributed via
npm.
Test plan
Manually ran
yarn installin thenpm-distributiondirectory to verify that it works as expected. There's no reliable way to test this change without trying to run the actual release step to npmjs.com.