createRelease function
void
createRelease({})
Implementation
void createRelease(
{required String username,
required String apiToken,
required String owner,
required String repository}) {
final sgh = SimpleGitHub(
username: username,
apiToken: apiToken,
owner: owner,
repository: repository);
sgh.auth();
final pubspecPath = findPubSpec(startingDir: pwd);
if (pubspecPath == null) {
print('Unable to find pubspec.yaml, run release from the '
"package's root directory.");
exit(-1);
}
final pubspec = PubSpec.fromFile(pubspecPath);
final version = pubspec.version.toString();
final String tagName = version;
print('Creating release for $tagName');
_createRelease(sgh: sgh, pubspec: pubspec, tagName: tagName);
updateLatestTag(sgh: sgh, pubspec: pubspec);
sgh.dispose();
}