### Body

Same as https://github.com/apache/airflow/issues/33876 but for `publish-docs` command.

### Committer

- [X] I acknowledge that I am a maintainer/committer of the Apache Airflow project.
filename_prefix: str, filename_pattern: Pattern[str]
) -> Generator[str, None, None]:
    for file in DIST_DIR.glob(f"{filename_prefix}*.tar.gz"):
        matched = filename_pattern.match(file.name)
        if not matched:
            raise Exception(f"Cannot parse provider package name from {file.name}")
        provider_package_id = matched.group(1).replace("-", ".")
        yield provider_package_id
def get_all_providers_in_dist(package_format: str, install_selected_providers: str) -> list[str]: