Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a workflow to publish the library on npm #27

Merged
merged 1 commit into from
Dec 13, 2024
Merged

Conversation

delanni
Copy link
Owner

@delanni delanni commented Dec 13, 2024

Add a workflow to publish the library on npm.

  • package.json

    • Add publish script to the scripts section to run npm publish.
  • .github/workflows/publish.yml

    • Create a new workflow file to handle publishing to npm.
    • Trigger the workflow using workflow_dispatch.
    • Set up Node.js environment and install dependencies.
    • Build the project using npm run build.
    • Publish the package to npm using npm publish.
    • Authenticate with npm using a secret token stored in the repository's secrets.
  • .npmrc

    • Create a new .npmrc file to handle npm authentication.
    • Add //registry.npmjs.org/:_authToken=${NPM_TOKEN} to the file.

For more details, open the Copilot Workspace session.

Add a workflow to publish the library on npm.

* **package.json**
  - Add `publish` script to the `scripts` section to run `npm publish`.

* **.github/workflows/publish.yml**
  - Create a new workflow file to handle publishing to npm.
  - Trigger the workflow using `workflow_dispatch`.
  - Set up Node.js environment and install dependencies.
  - Build the project using `npm run build`.
  - Publish the package to npm using `npm publish`.
  - Authenticate with npm using a secret token stored in the repository's secrets.

* **.npmrc**
  - Create a new `.npmrc` file to handle npm authentication.
  - Add `//registry.npmjs.org/:_authToken=${NPM_TOKEN}` to the file.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/delanni/if-expression?shareId=XXXX-XXXX-XXXX-XXXX).
@delanni delanni merged commit b2e9d4d into master Dec 13, 2024
1 check passed
@delanni delanni deleted the add-publish-workflow branch December 13, 2024 16:55
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.

1 participant