gg_one_do_publish

The publish orchestrator of the gg_one tool family - version bump, changelog, registry upload, merge, tags and resume.

Upgrade before publishing

gg one do publish upgrades no dependency by default: a release ships the constraints that were committed and tested. --upgrade (upgrade: true from code) runs dart pub upgrade [--major-versions] --tighten right before can publish and commits what it changed; --major-versions only when the repository's .gg/gg_rc sets do.upgrade.deps.majorVersions. pana does not stand in the way of a release without upgrade: it keeps granting the points for up-to-date dependencies for 30 days after a new major version of a dependency.

The npm upload runs no package scripts

npm runs a package's publish scripts inside the upload: prepublishOnly builds, and the build's prebuild runs the whole test suite once more — although the checks passed for this very state. When those scripts only build and test (publishLifecycleOnlyTestsAndBuilds of gg_lang), gg runs them itself before the upload: the tests only where the checks have not passed for the uploaded state (a repository that switches its commit checks off always tests), then the build without its prebuild. The upload then passes --ignore-scripts. Any other publish script — a prepack, a prepare, a postbuild — keeps npm's own lifecycle. So do npm and yarn as package managers: only pnpm leaves out just the hooks of build — npm run build --ignore-scripts also drops those of every npm run inside the build.

Leaving only the test prebuild out of the upload's own lifecycle would need no --ignore-scripts, but the build would then still run while the upload holds the terminal; run beforehand, it shares the check slots with the other packages of a multi-repo publish.

Publishing several repositories at once

One DoPublish may publish several repositories at the same time. Three entries in the options of DoPublish.exec are for a caller that does so: {waitUntilPublishedOption: false} skips the wait until the registries show the new version, {uploadExclusivelyOption: <RunExclusively>} hands the upload to the caller, who decides when it runs, and {runChecksOption: <RunExclusively>} does the same for the tests and the build before an npm upload.

Libraries

gg_one_do_publish