-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[tool] Add a package-level pre-publish hook #7156
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Code looks good to me, but I do have some thoughts on the use case. It looks like this is mainly being done to build binaries/artifacts before publishing. Could it be possible that building could be needed outside of publishing (as in for testing)? Should the script be called something like generate.dart
instead so that other commands could potentially make use of it?
In general, I think special script entry points should be clearly named, and then if we have code we want to run from multiple entry points the best option is to factor that out into code that the different entry point files can call into. |
auto label is removed for flutter/packages/7156, due to - The status or check suite Mac_arm64 ios_platform_tests_shard_3 master has failed. Please fix the issues identified (or deflake) before re-applying this label.
|
auto label is removed for flutter/packages/7156, due to - The status or check suite Mac_arm64 ios_platform_tests_shard_3 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
flutter/packages@19daf6f...3d358d9 2024-07-26 reidbaker@google.com [many] Ignore NewerVersionAvailable in android lint (flutter/packages#7218) 2024-07-25 rexios@rexios.dev [tool] Adds `--wasm` flag to the `drive-examples` command (flutter/packages#7162) 2024-07-25 stuartmorgan@google.com [tool] Add a package-level pre-publish hook (flutter/packages#7156) 2024-07-25 srawlins@google.com [flutter_migrate] Remove one set of parens that wrap a single String literal (flutter/packages#7216) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@19daf6f...3d358d9 2024-07-26 reidbaker@google.com [many] Ignore NewerVersionAvailable in android lint (flutter/packages#7218) 2024-07-25 rexios@rexios.dev [tool] Adds `--wasm` flag to the `drive-examples` command (flutter/packages#7162) 2024-07-25 stuartmorgan@google.com [tool] Add a package-level pre-publish hook (flutter/packages#7156) 2024-07-25 srawlins@google.com [flutter_migrate] Remove one set of parens that wrap a single String literal (flutter/packages#7216) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@19daf6f...3d358d9 2024-07-26 reidbaker@google.com [many] Ignore NewerVersionAvailable in android lint (flutter/packages#7218) 2024-07-25 rexios@rexios.dev [tool] Adds `--wasm` flag to the `drive-examples` command (flutter/packages#7162) 2024-07-25 stuartmorgan@google.com [tool] Add a package-level pre-publish hook (flutter/packages#7156) 2024-07-25 srawlins@google.com [flutter_migrate] Remove one set of parens that wrap a single String literal (flutter/packages#7216) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Adds the ability for a package to specify a script that should be run before publishing. To minimize the chance of such a script breaking things only in the post-submit
release
step, if the script is present it will also be run duringpublish-check
.These should be used with caution since they can cause the published artifacts to be different from that is checked in, but in the intended use case of extension builds this risk is far preferable to the risks associated with checking in binaries that were built on local, ad-hoc basis. (Longer term, we may need an alternate solution however, as generating artifacts in CI can have its own supply chain validation issues.)
Also does some minor refactoring to custom test script code to make it follow the same pattern as this new code.
Fixes flutter/flutter#150210
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes.///
).