In order to deploy the code into the Github NPM package registry, you will need to login in it.
I suggest following the steps from 1 to 6 of this article: https://dev.to/dalenguyen/create-your-first-github-package-564f
yarn version
can be used when deploying a new version during the pipeline process. Some use arguments are --major
, --minor
and --patch
to update the respectively numbers automatically.
yarn
is not yet fully supported by github packages.
In order to use it with yarn
, do the following:
In the same folder of package.json, you must have a .npmrc
file with the
following:
@demonkart:registry=https://npm.pkg.github.com/
If the package is published to a private repository, a github Personal Access
Token (PAT)
will be required for yarn being able to find and install it. In the CI pipelines
that uses the private package, the .npmrc
should have the additional line below:
//npm.pkg.github.com/:_authToken=${MY_GITHUB_TOKEN}
@demonkart:registry=https://npm.pkg.github.com/
This extra line contains the _authToken
environment variable
(MY_GITHUB_TOKEN
in this example) which should have the PAT created above as
the value.
Note: The CI pipeline must have an env var with the same name and its value (the PAT) should come from a secret for security reasons.
To add it via yarn:
yarn add @demonkart/shared-deps-poc
If you prefer to edit package.json
directly:
"dependencies": {
"@demonkart/shared-deps-poc": "^1.0.4",
}
and then running yarn --update-checksums
yarn build
yarn test
yarn deploy