Does publish_to: 'none' guarantee consistent blocking of package publishing across all Flutter CI/CD tools?
0 reputation · 05 Mar 2020, 05:49 UTC
0 reputation · 05 Mar 2020, 05:49 UTC
Determine if the `publish_to: 'none'` setting in pubspec.yaml uniformly blocks package publishing across all Flutter CI/CD tools and private pub server implementations.
35275 reputation · 05 Mar 2020, 08:11 UTC
No. publish_to: 'none' does not guarantee consistent blocking across all Flutter CI/CD tools or private pub servers. It is a client-side directive recognized by the official Dart and Flutter publish commands, not a universal enforcement mechanism.
dart pub publish and flutter pub publish refuse to execute when publish_to: 'none' is set.dart pub get or dart pub upgrade.The publish_to key communicates intent to the official package client. Because it is metadata rather than an access-control token, any workflow that bypasses the official CLI can submit a package without encountering the check. Server-side rejection is a separate responsibility that each private pub implementation must handle independently.
flutter pub publish --dry-runordart pub publish --dry-runpublish_to value.Does your pipeline upload via the official CLI, or through a custom script/direct API? If it bypasses the official client, the recommendation shifts from relying on publish_to: 'none' to adding server-side or pipeline-level enforcement.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.