add publish workflow for this to publish to npm on tag creation#70
add publish workflow for this to publish to npm on tag creation#70niteshsandal-merge merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Other comments (1)
-
.github/workflows/ci.yml (24-25)
The workflow duplicates the build steps in both jobs. Consider using GitHub's artifact feature to share the build output between jobs to avoid rebuilding:
- In the compile job, add:
- name: Upload build artifacts uses: actions/upload-artifact@v3 with: name: build-output path: dist/ # Adjust this to your build output directory
- In the publish job, replace the build step with:
- name: Download build artifacts uses: actions/download-artifact@v3 with: name: build-output path: dist/ # Adjust this to your build output directory
💡 To request another review, post a new comment with "/windsurf-review".
| - uses: actions/setup-node@v6 | ||
| - run: npm ci | ||
| - run: npm run build | ||
| - name: Publish to npm |
There was a problem hiding this comment.
The workflow is missing npm authentication configuration. To publish to npm, you need to set up authentication using the NODE_AUTH_TOKEN secret. Consider adding this to your setup-node action in the publish job:
| - uses: actions/setup-node@v6 | |
| - run: npm ci | |
| - run: npm run build | |
| - name: Publish to npm | |
| - uses: actions/setup-node@v6 | |
| with: | |
| registry-url: 'https://registry.npmjs.org' |
And then add the NODE_AUTH_TOKEN to your publish step:
| - uses: actions/setup-node@v6 | |
| - run: npm ci | |
| - run: npm run build | |
| - name: Publish to npm | |
| - name: Publish to npm | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | |
There was a problem hiding this comment.
+1 to this do we have these secrets set up?
There was a problem hiding this comment.
shouldn't be needed with OIDC
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-node@v6 |
There was a problem hiding this comment.
The setup-node action is missing the node-version parameter. This could lead to inconsistent builds if GitHub Actions' default Node.js version changes. Consider specifying a version like:
| - uses: actions/setup-node@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '18' |
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-node@v6 |
There was a problem hiding this comment.
Similarly, the setup-node action in the publish job should specify a Node.js version for consistency:
| - uses: actions/setup-node@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '18' |
| @@ -0,0 +1,37 @@ | |||
| name: ci | |||
|
|
|||
| on: [push] | |||
There was a problem hiding this comment.
should this only be on push to main?
| @@ -0,0 +1,37 @@ | |||
| name: ci | |||
There was a problem hiding this comment.
nit shud we name this something else since its not in ci
Description of the change
As title
Type of change
Related issues
Checklists
Development
Code review