9 Commits

Author SHA1 Message Date
50238e7dd3 [tool] Add a package-level pre-publish hook (#7156)
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 during `publish-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 https://github.com/flutter/flutter/issues/150210
2024-07-25 20:06:18 +00:00
6a4e2ffbc4 [tool] Add features to support GCB auto-publish flow (#6218)
Adds the flowing to the tool:
- A new `--exact-match-only` flag to be used with `--packages` to prevent group matching (i.e., a selection like `--packages=path_provider --exact-match-only` would only run on `packages/path_provider/path_provider`, not `packages/path_provider/*`).
- Two new `publish` command flags:
  - `--tag-for-auto-publish`, to do all the steps that `publish` currently does except for the real `pub publish`, so it would dry-run the publish and then create and push the tag if successful.
  - `--already-tagged`, to skip the step of adding and pushing a tag, and replace it with a check that `HEAD` already has the expected tag.

This set of additions supports a workflow where the current `release` step is changed to use `--tag-for-auto-publish`, and then the separate auto-publish system would publish each package with `... publish --already-tagged --packages=<some package> --exact-match-only`.

See https://github.com/flutter/packages/pull/5005#discussion_r1344542422 for previous discussion/context.

Part of https://github.com/flutter/flutter/issues/126827
2024-03-05 22:34:58 +00:00
28c419d2ab [tool] Conditionalize color on stdout (#4436)
Refactors colorization to a centralized utility file, and makes it all conditional on `stdout` having ANSI escape support. This makes the output more readable on LUCI, which unlike the Cirrus log display doesn't handle ANSI.

Fixes https://github.com/flutter/flutter/issues/89392
2023-07-11 19:02:59 +00:00
2b38236a95 [ci] Re-enable Windows repo tool tests (#4007)
Fixes publish test to always expect the command being run to be 'flutter', since it uses a mock platform that reports as Linux.

Fixes https://github.com/flutter/flutter/issues/126750
2023-05-17 01:22:30 +00:00
1015be0916 [tool] Ensure that publish credential path is available (#3970)
When writing pub credentials, ensure that the target paths exists before
trying to write the file. In the past this would have worked because the
credentials were in the pub cache, and the pub cache would exist by the
time the repo tooling code was running. The new location, however, is a
configuration directory that is unlikely to exist before anything
involving `pub` credentials has run.

Should fix the latest `release` failure:

https://github.com/flutter/packages/actions/runs/4949005383/jobs/8854219784
2023-05-11 15:50:00 -04:00
5b7d732939 [tool] Use new pub cache location for publish (#3962)
As of Dart 3.0 (Flutter 3.10), the location that the tool was using for
the pub cache wasn't being read, breaking autopublish in CI. This
updates to the new location, and adds tests for it.

Should fix the fact that the `release` step hangs on every package
change now.
2023-05-11 06:11:46 -04:00
f224eea858 [tool] Add pigeon support to update-dependency (#3640)
[tool] Add pigeon support to update-dependency
2023-04-05 10:44:19 +00:00
92330dbd2c Enable no_leading_underscores_for_local_identifiers (#6509) 2022-09-28 18:22:46 +00:00
9974a8ef44 [tool] Clean up "plugin" references (#6503) 2022-09-27 19:43:04 +00:00