Skip to content

[tool] Always run publish check #3279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions packages/flutter_markdown/.vscode/launch.json

This file was deleted.

160 changes: 0 additions & 160 deletions packages/palette_generator/example/android/gradlew

This file was deleted.

90 changes: 0 additions & 90 deletions packages/palette_generator/example/android/gradlew.bat

This file was deleted.

19 changes: 12 additions & 7 deletions script/tool/lib/src/publish_check_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,23 @@ class PublishCheckCommand extends PackageLoopingCommand {
final _PublishCheckResult alreadyPublishedResult =
await _checkPublishingStatus(
packageName: packageName, version: version);
if (alreadyPublishedResult == _PublishCheckResult.nothingToPublish) {
print(
'Package $packageName version: $version has already be published on pub.');
return alreadyPublishedResult;
} else if (alreadyPublishedResult == _PublishCheckResult.error) {
if (alreadyPublishedResult == _PublishCheckResult.error) {
print('Check pub version failed $packageName');
return _PublishCheckResult.error;
}

// Run the dry run even if no publishing is needed, so that changes in pub
// behavior (e.g., new checks that some existing packages may fail) are
// caught by CI in the Flutter roller, rather than the next time the package
// package is actually published.
if (await _hasValidPublishCheckRun(package)) {
print('Package $packageName is able to be published.');
return _PublishCheckResult.needsPublishing;
if (alreadyPublishedResult == _PublishCheckResult.nothingToPublish) {
print(
'Package $packageName version: $version has already been published on pub.');
} else {
print('Package $packageName is able to be published.');
}
return alreadyPublishedResult;
} else {
print('Unable to publish $packageName');
return _PublishCheckResult.error;
Expand Down
Loading