publish-unscoped-package-to-npm-and-github
v1.0.1
Published
Testing of publishing an unscoped NPM package to Github Package Registry
Downloads
4
Maintainers
Readme
publish-unscoped-package-to-npm-and-github
Inspired by Dev.to article and this issue
Testing of publishing an unscoped NPM package to Github Package Registry
NPM:
GPR (GitHub Package Registry):
Steps
- Add
publishConfig
section to your package.json
"publishConfig": {
"registry": "https://registry-url"
}
Modify your .github/workflows/deploy.yml file
Add
NPM_AUTH_TOKEN
variable in your Repository > Settings > Secrets > New repository secret button.GITHUB_TOKEN
already existsSuccess :tada:
Usage
From NPM:
npm install publish-unscoped-package-to-npm-and-github
From GPR:
npm install @denisstasyev/publish-unscoped-package-to-npm-and-github
Possibly you will need .npmrc file:
@denisstasyev:registry = https://npm.pkg.github.com
Find out the registry used: npm config get registry
Show complete package manager configuration: npm config ls -l
Workflow file
Some notes here how to understand this workflow file:
Now this repository contains the simplest example, you need to manually raise the version for publication. For automatic version control you can use some tools like semantic-release (example of usage in Github Action and necessary .releaserc.json file)