-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up NPM packaging as a private package (#31)
Addresses ENG-1642. Includes updates to package.json (prepublishOnly script, GPLv3 license, "p0" entrypoint, packaged files) needed in order to serve package on NPM. Note that currently it is published as @komaldhull/p0cli, a private package under my NPM user. This is just for testing purposes. When we are ready to make it public, I have created an organization called "p0security", and we can publish it under @p0security/p0cli. The ticket ENG-1531 captures this TODO. Also adds a Github workflow to publish the package to NPM when a github release is published. Tested via installing the CLI using npm install -g (if you send me your NPM username, I can add you to the private package so you can test as well), and tested the workflow by triggering it manually and verifying that publish succeeds.
- Loading branch information
1 parent
89d5b2b
commit eb85d77
Showing
7 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | ||
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | ||
|
||
name: Node.js Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish-npm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ^20.4.0 | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Yarn install | ||
run: yarn install --ignore-engines --frozen-lockfile | ||
- name: Publish npm package | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,6 @@ dist | |
.pnp.* | ||
|
||
build/ | ||
|
||
dist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters