Your first publish
glpkg publish publishes the package in the current directory to the package registry of
the GitLab project that the current Git repository belongs to.
Before you start
-
A saved token with the
apiscope (Authentication). -
gitand the GitLab CLIglabinstalled. glpkg runsglab api projects/:idto find the project of the current repository. -
The repository exists on GitLab and is the
originof your checkout. glpkg does not create projects. To create one, useglpkg repo create:glpkg repo create your-org/utils --path . -
A scoped package name in
package.json, for example@your-org/utils. -
A clean working tree. Commit or stash your changes first (or pass
--force).
1. Dry run
glpkg publish --dry-run
This detects the project, applies any version bump, and runs npm publish --dry-run.
Your manifest files are restored afterwards, so a dry run leaves the working tree unchanged.
2. Publish
glpkg publish # publish the version in package.json
glpkg publish --bump patch # 1.2.3 → 1.2.4, then publish
After a successful publish, glpkg by default:
- Commits
package.jsonwith the messagechore: release v<version>. - Tags the commit
v<version>. - Runs
git pushandgit push --tags.
To skip the Git steps:
glpkg publish --bump patch --git-tag false --push false
3. Install it elsewhere
glpkg install @your-org/utils --group your-org
Pre-release channels
glpkg publish beta --bump minor # 1.2.3 → 1.3.0-beta.0, dist-tag "beta"
glpkg publish dev # 1.2.3 → 1.2.3-dev.<timestamp>, dist-tag "dev"
See glpkg publish for all options.