Publishing Packages
Once you have built a package with dpm pack, you can publish it to a package source so that others (or your own projects) can install it. Publishing is done with the dpm push command.
DPM supports two kinds of targets:
- A folder source (local or UNC path) -
dpm pushsimply copies the.dpkgfile into the source folder. - A server source (an HTTPS DPM server such as
https://delphi.dev) -dpm pushuploads the file over HTTP and the server publishes it.
Before you push
Build the package.
dpm packproduces one.dpkgfile per compiler in your spec, for exampleVSoft.CommandLine.1.0.1.dpkg.Sign the package (optional but recommended). For server sources you will usually want to sign the package first so consumers can verify its origin and integrity. See Package Signing for background.
batdpm sign .\VSoft.CommandLine.1.0.1.dpkg --thumbprint=AB12CD34EF56Make sure the target source is registered. Pushing uses a source by name (or url). Add one with the sources command if you have not already:
batdpm sources add -name=local -source=\\myserver\dpmsource
The public repository is automatically enabled when you first use dpm.
API keys
A server source requires an API key to authorise the upload. Folder sources do not.
The key can be supplied in two ways:
- Per command, with the
-apiKeyoption. - Stored against the source in your dpm.config file (the
apiKeyproperty of the package source).
Pushing to a folder source
For a folder or UNC source, the package file is copied into the source folder. No API key is needed, however you do need write permissions to the folder.
dpm push .\VSoft.CommandLine.1.0.1.dpkg -source=localPushing to a server source
For an HTTPS server source, the package is uploaded over HTTPS. An API key is required.
dpm push .\VSoft.CommandLine.1.0.1.dpkg -source=dpm -apiKey=abcdefPushing multiple files
dpm pack typically produces several .dpkg files (one per compiler / platform). Each must be pushed. On the command line you can loop over the output folder:
for %f in (.\output\*.dpkg) do dpm push "%f" -source=dpmIf a package and version already exist on the source, use -skipDuplicate so the push skips it instead of failing - handy when re-running a publish step:
dpm push .\output\*.dpkg -source=dpm -skipDuplicateRe-publishing and versions
Package sources treat a published id + version as immutable. To publish a change you must bump the version and pack again - you cannot overwrite an existing version. Use dpm pack -version=... to set the version at pack time if you do not want to edit the spec.
See also
- push command - full option reference.
- pack command - build
.dpkgfiles from a spec. - sign command - sign a package before publishing.
- sources command - register and manage package sources.
- Package Sources - folder vs server sources.
- Config Files - where API keys and sources are stored.