I got access to the github package registry beta, just fiddled with it and followed the configuration steps to publish.
The thing is, I published it correctly, but noticed it didn't publish to npm. Is there a way to publish in both registries with the same command? Does it make sense to have the package published in both registries?
Also, my package name in the package.json
is @alvarocastro/quicksort
(as stated in the doc) and the name in the github page ends up being that, but in the command example to install, the scope is duplicated, eg: @alvarocastro/@alvarocastro/quicksort
Here is the complete package.json
file as a reference:
{
"name": "@alvarocastro/quicksort",
"version": "1.0.1",
"description": "An implementation of the quicksort algorithm",
"main": "index.js",
"scripts": {
"performance": "node performance.js",
"test": "xo && nyc ava",
"coverage": "nyc report --reporter=text-lcov | coveralls"
},
"publishConfig": {
"registry":"https://npm.pkg.github.com/@alvarocastro"
},
"repository": {
"type": "git",
"url": "git+https://github.com/alvarocastro/quicksort.git"
},
"keywords": [
"quicksort",
"sort",
"algorithm"
],
"author": "Alvaro Castro",
"license": "MIT",
"bugs": {
"url": "https://github.com/alvarocastro/quicksort/issues"
},
"homepage": "https://github.com/alvarocastro/quicksort#readme",
"devDependencies": {
"ava": "2.3.0",
"coveralls": "3.0.6",
"nyc": "14.1.1",
"xo": "0.24.0"
}
}
publishConfig
property in thepackage.json
, you say I should make an action that does that? Also, I'm a total noob of github actions, will do a bit of research later. – Invocatepackage.json
, since you can simply reset npm to use GPR as default registry: there's an example you can check in the "Usage" section ofactions/setup-node
, here. The part that will be more tricky is checking whether you pushed a new version: the easiest way would be to just run the thing when you create a new release, but that will force you to manually add a release every time you want to publish a new version... – Osuna