Skip to content

npm public release with GitHub Actions#193

Merged
1a1a11a merged 8 commits into1a1a11a:developfrom
realtmxi:murphy/npm-release-0616
Jun 18, 2025
Merged

npm public release with GitHub Actions#193
1a1a11a merged 8 commits into1a1a11a:developfrom
realtmxi:murphy/npm-release-0616

Conversation

@realtmxi
Copy link
Copy Markdown
Contributor

  • Add Github Action release workflow for CI/CD
  • users could install npm install libcachesim from the pre-build binaries in different platforms

@realtmxi realtmxi marked this pull request as ready for review June 16, 2025 08:02
@codemetrics-ai
Copy link
Copy Markdown

⚠️ Your Codemetrics free trial has expired. To continue using AI based pull request reviews, please subscribe to premium in team settings.

@realtmxi
Copy link
Copy Markdown
Contributor Author

realtmxi commented Jun 16, 2025

Hi, I've completed the development of testing for the npm public release. The bindings are working well and i've successfully tested them with a published test package https://www.npmjs.com/package/@realtmxi/libcachesim-node?activeTab=code (support linux platform only)

To enable automatic npm package publishing form the main repo, you'll need to

  1. Create npm accout and get token
npm login
npm token create --read-only=false
  1. add npm token to github secrets
    go to https://www.npmjs.com/package/@realtmxi/libcachesim-node?activeTab=code, click new repository secret, Name NPM_TOKEN, then paste the token from step1
  2. Then, the package will be published

@1a1a11a 1a1a11a merged commit 598d7d3 into 1a1a11a:develop Jun 18, 2025
4 of 5 checks passed
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: NPM Workflow Triggers Unintended Releases

The NPM release workflow triggers on both release: published events and push to the develop branch, leading to unintended behavior:

  • Unintended GitHub Releases: Pushes to develop will attempt to create a GitHub release if one doesn't exist for the current package version, potentially creating releases from development commits.
  • Unintended NPM Publishing: The build-and-publish and publish-npm jobs run unconditionally, even if the create-release job skipped creating a release. This results in the package being published to NPM on every develop push, and causes unnecessary rebuilds and re-publishing when triggered by an already published release.

.github/workflows/npm-release.yml#L2-L11

on:
release:
types: [published]
push:
branches:
- develop
paths:
- 'libCacheSim-node/**'

.github/workflows/npm-release.yml#L71-L74

build-and-publish:
needs: create-release
runs-on: ubuntu-latest

Fix in Cursor


BugBot free trial expires on June 25, 2025
You have used $0.00 of your $20.00 spend limit so far. Manage your spend limit in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants