From d88e419e5ecbf0699c72c1c177a6198a231399c0 Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Wed, 2 Oct 2024 09:34:26 -0700 Subject: [PATCH] In the buildbot CI step, reset built web files before trying to publish These files can have minor differences in them (depending on the version of Dart?), so that it is difficult for them to always be identical to the ones checked in, during CI. Then there is a new warning that `pub publish --dry-run` produces, if the current git checkout is not clean: https://github.com/dart-lang/pub/pull/4373. We need to reset these files to avoid that warning. --- tool/task.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tool/task.dart b/tool/task.dart index 5e7f8a0f5e..d6eb083c1b 100644 --- a/tool/task.dart +++ b/tool/task.dart @@ -834,6 +834,15 @@ Rebuild them with "dart tool/task.dart build" and check the results in. 'The web frontend (web/docs.dart) needs to be recompiled; rebuild it ' 'with "dart tool/task.dart build web".'); } + + // Reset some files for `try-publish` step. This check looks for changes in + // the current git checkout: https://github.com/dart-lang/pub/pull/4373. + Process.runSync('git', [ + 'checkout', + '--', + 'lib/resources/docs.dart.js', + 'lib/resources/docs.dart.js.map', + ]); } /// Whether the analyzer in use (as found in `pubspec.lock`) is the target