{"id":15479723,"url":"https://github.com/gr2m/semantic-release-github-npm-registry","last_synced_at":"2025-04-15T05:47:49.578Z","repository":{"id":66069741,"uuid":"186068143","full_name":"gr2m/semantic-release-github-npm-registry","owner":"gr2m","description":"semantic-release plugin to publish an npm package to GitHub’s npm registry","archived":false,"fork":false,"pushed_at":"2020-10-15T00:04:23.000Z","size":4,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T13:58:16.397Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gr2m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-05-10T23:58:23.000Z","updated_at":"2024-03-21T18:30:02.000Z","dependencies_parsed_at":"2023-02-20T19:00:46.218Z","dependency_job_id":null,"html_url":"https://github.com/gr2m/semantic-release-github-npm-registry","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"96f9d0e203552d3f0e1998b49fe4aa4dafa2ecb3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fsemantic-release-github-npm-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fsemantic-release-github-npm-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fsemantic-release-github-npm-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fsemantic-release-github-npm-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gr2m","download_url":"https://codeload.github.com/gr2m/semantic-release-github-npm-registry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248537702,"owners_count":21120847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T04:25:13.624Z","updated_at":"2025-04-15T05:47:49.558Z","avatar_url":"https://github.com/gr2m.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚧 THIS IS WORK IN PROGRESS\n\nSee [#1](https://github.com/semantic-release/github-npm-registry/pull/1) for the initial implementation.\n\n# @semantic-release/github-npm-registry\n\n[**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to publish an [npm](https://www.npmjs.com) package to [GitHub’s npm registry](https://help.github.com/en/articles/configuring-npm-for-use-with-github-package-registry).\n\n| Step               | Description                                                                                                                                                                         |\n| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `verifyConditions` | Verify the presence of the `GITHUB_TOKEN` environment variable, create or update the `.npmrc` file with GitHub’s npm registry URL, the token and verify the token is valid.         |\n| `prepare`          | Update the `package.json` version and [create](https://docs.npmjs.com/cli/pack) the npm package tarball.                                                                            |\n| `publish`          | [Publish the npm package](https://docs.npmjs.com/cli/publish) to [GitHub’s npm registry](https://help.github.com/en/articles/configuring-npm-for-use-with-github-package-registry). |\n\n## Install\n\n```bash\n$ npm install @semantic-release/github-npm-registry -D\n```\n\n## Usage\n\nThe plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):\n\n```json\n{\n  \"plugins\": [\"@semantic-release/commit-analyzer\", \"@semantic-release/release-notes-generator\", \"@semantic-release/npm\"]\n}\n```\n\n## Configuration\n\n### Npm registry authentication\n\nThe npm authentication configuration is **required** and can be set via [environment variables](#environment-variables).\n\nBoth the [token](https://docs.npmjs.com/getting-started/working_with_tokens) and the legacy (`username`, `password` and `email`) authentication are supported. It is recommended to use the [token](https://docs.npmjs.com/getting-started/working_with_tokens) authentication. The legacy authentication is supported as the alternative npm registries [Artifactory](https://www.jfrog.com/open-source/#os-arti) and [npm-registry-couchapp](https://github.com/npm/npm-registry-couchapp) only supports that form of authentication.\n\n**Note**: Only the `auth-only` [level of npm two-factor authentication](https://docs.npmjs.com/getting-started/using-two-factor-authentication#levels-of-authentication) is supported, **semantic-release** will not work with the default `auth-and-writes` level.\n\n### Environment variables\n\n| Variable       | Description                                                                                                                   |\n| -------------- | ----------------------------------------------------------------------------------------------------------------------------- |\n| `NPM_TOKEN`    | Npm token created via [npm token create](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) |\n| `NPM_USERNAME` | Npm username created via [npm adduser](https://docs.npmjs.com/cli/adduser) or on [npmjs.com](https://www.npmjs.com)           |\n| `NPM_PASSWORD` | Password of the npm user.                                                                                                     |\n| `NPM_EMAIL`    | Email address associated with the npm user                                                                                    |\n\nUse either `NPM_TOKEN` for token authentication or `NPM_USERNAME`, `NPM_PASSWORD` and `NPM_EMAIL` for legacy authentication\n\n### Options\n\n| Options      | Description                                                                                                         | Default                                                                                                                          |\n| ------------ | ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| `npmPublish` | Whether to publish the `npm` package to the registry. If `false` the `package.json` version will still be updated.  | `false` if the `package.json` [private](https://docs.npmjs.com/files/package.json#private) property is `true`, `true` otherwise. |\n| `pkgRoot`    | Directory path to publish.                                                                                          | `.`                                                                                                                              |\n| `tarballDir` | Directory path in which to write the the package tarball. If `false` the tarball is not be kept on the file system. | `false`                                                                                                                          |\n\n**Note**: The `pkgRoot` directory must contain a `package.json`. The version will be updated only in the `package.json` and `npm-shrinkwrap.json` within the `pkgRoot` directory.\n\n**Note**: If you use a [shareable configuration](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/shareable-configurations.md#shareable-configurations) that defines one of these options you can set it to `false` in your [**semantic-release** configuration](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration) in order to use the default value.\n\n### Npm configuration\n\nThe plugin uses the [`npm` CLI](https://github.com/npm/cli) which will read the configuration from [`.npmrc`](https://docs.npmjs.com/files/npmrc). See [`npm config`](https://docs.npmjs.com/misc/config) for the option list.\n\nThe [`dist-tag`](https://docs.npmjs.com/cli/dist-tag) can be configured in the `package.json` and will take precedence over the configuration in `.npmrc`:\n\n```json\n{\n  \"publishConfig\": {\n    \"tag\": \"latest\"\n  }\n}\n```\n\nThe [`registry`](https://docs.npmjs.com/misc/registry) setting will be ignored. It is hardcoded to `https://npm.pkg.github.com`.\n\n### Examples\n\nThe `npmPublish` and `tarballDir` option can be used to skip the publishing to the `npm` registry and instead, release the package tarball with another plugin. For example with the [@semantic-release/github](https://github.com/semantic-release/github) plugin:\n\n```json\n{\n  \"plugins\": [\n    \"@semantic-release/commit-analyzer\",\n    \"@semantic-release/release-notes-generator\",\n    [\n      \"@semantic-release/npm\",\n      {\n        \"npmPublish\": false,\n        \"tarballDir\": \"dist\"\n      }\n    ],\n    [\n      \"@semantic-release/github\",\n      {\n        \"assets\": \"dist/*.tgz\"\n      }\n    ]\n  ]\n}\n```\n\nWhen publishing from a sub-directory with the `pkgRoot` option, the `package.json` and `npm-shrinkwrap.json` updated with the new version can be moved to another directory with a `postpublish` [npm script](https://docs.npmjs.com/misc/scripts). For example with the [@semantic-release/git](https://github.com/semantic-release/git) plugin:\n\n```json\n{\n  \"plugins\": [\n    \"@semantic-release/commit-analyzer\",\n    \"@semantic-release/release-notes-generator\",\n    [\n      \"@semantic-release/npm\",\n      {\n        \"pkgRoot\": \"dist\"\n      }\n    ],\n    [\n      \"@semantic-release/git\",\n      {\n        \"assets\": [\"package.json\", \"npm-shrinkwrap.json\"]\n      }\n    ]\n  ]\n}\n```\n\n```json\n{\n  \"scripts\": {\n    \"postpublish\": \"cp -r dist/package.json . \u0026\u0026 cp -r dist/npm-shrinkwrap.json .\"\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Fsemantic-release-github-npm-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgr2m%2Fsemantic-release-github-npm-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Fsemantic-release-github-npm-registry/lists"}