function publish(force) {
  return (done) => {
    const releaseDir = 'dist/plugins';
    exitIfNoReleaseDir(releaseDir, done);

    // Run lerna publish. Uses conventional commits for versioning
    // creates the release on GitHub.
    console.log(`Publishing ${force ? 'all' : 'changed'} plugins.`);
    execSync(
      `lerna publish --conventional-commits --create-release github` +
        `${force ? ' --force-publish=*' : ''}`,
      {cwd: releaseDir, stdio: 'inherit'},
    );

    console.log('Removing release directory.');
    rimraf.sync(releaseDir);

    done();
  };
}
This script does not log into the npm publish service. If you haven't run
the prepare script recently, publishing will fail for that reason.
@param {boolean=} force True for forcing all plugins to publish, even ones
    that have not changed.
@returns {Function} Gulp task.