diff --git a/dev/bots/prepare_package.dart b/dev/bots/prepare_package.dart index 843966de7d..2f42a43e25 100644 --- a/dev/bots/prepare_package.dart +++ b/dev/bots/prepare_package.dart @@ -414,9 +414,14 @@ class ArchiveCreator { } /// Create a zip archive from the directory source. - Future _createZipArchive(File output, Directory source) { + Future _createZipArchive(File output, Directory source) async { List commandLine; if (platform.isWindows) { + // Unhide the .git folder, https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/attrib. + await _processRunner.runProcess( + ['attrib', '-h', '.git'], + workingDirectory: Directory(source.absolute.path), + ); commandLine = [ '7za', 'a', diff --git a/dev/bots/test/prepare_package_test.dart b/dev/bots/test/prepare_package_test.dart index 78c958b31c..78a5cc6877 100644 --- a/dev/bots/test/prepare_package_test.dart +++ b/dev/bots/test/prepare_package_test.dart @@ -122,6 +122,7 @@ void main() { '$flutter create --template=package ${createBase}package': null, '$flutter create --template=plugin ${createBase}plugin': null, 'git clean -f -X **/.packages': null, + if (platform.isWindows) 'attrib -h .git': null, if (platform.isWindows) '7za a -tzip -mx=9 $archiveName flutter': null else if (platform.isMacOS) 'zip -r -9 $archiveName flutter': null else if (platform.isLinux) 'tar cJf $archiveName flutter': null, @@ -156,6 +157,7 @@ void main() { '$flutter create --template=package ${createBase}package': null, '$flutter create --template=plugin ${createBase}plugin': null, 'git clean -f -X **/.packages': null, + if (platform.isWindows) 'attrib -h .git': null, if (platform.isWindows) '7za a -tzip -mx=9 $archiveName flutter': null else if (platform.isMacOS) 'zip -r -9 $archiveName flutter': null else if (platform.isLinux) 'tar cJf $archiveName flutter': null, @@ -205,6 +207,7 @@ void main() { '$flutter create --template=package ${createBase}package': null, '$flutter create --template=plugin ${createBase}plugin': null, 'git clean -f -X **/.packages': null, + if (platform.isWindows) 'attrib -h .git': null, if (platform.isWindows) '7za a -tzip -mx=9 $archiveName flutter': null else if (platform.isMacOS) 'zip -r -9 $archiveName flutter': null else if (platform.isLinux) 'tar cJf $archiveName flutter': null,