Publish is one of the commands of the pub tool.
$ pub publish [--dry-run] [--force] [--server <url>]
This command publishes your package on the Pub site for anyone to download and depend on. For information on how to prepare your package for publishing, and what files you should include or exclude, see Publishing packages.
For options that apply to all pub commands, see Global options.
With this, pub goes through the validation process but does not actually upload the package. This is useful if you want to see if your package meets all of the publishing requirements before you’re ready to actually go public.
With this, pub does not ask for confirmation before publishing. Normally, it shows you the package contents and asks for you to confirm the upload.
If your package has errors, pub doesn’t upload it and exits with an error.
In the event of warnings, your package is uploaded.
To ensure that your package has no warnings before uploading,
either don’t use
--force, or use
If you pass
--server followed by a URL, it attempts to publish the
package to that server. It assumes the server supports the same HTTP API that
the Pub site uses.
This can be useful if you’re running your own local package server for testing. The main pub server is itself open source and available here.