8000 Merge branch '4.3' into 4.4 · symfony/symfony@0bc6b91 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0bc6b91

Browse files
Merge branch '4.3' into 4.4
* 4.3: [travis] honor .gitattributes when building local packages
2 parents 3e48be0 + 418c78c commit 0bc6b91

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/build-packages.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
$packages = array();
1919
$flags = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
20+
$preferredInstall = json_decode(file_get_contents(__DIR__.'/composer-config.json'), true)['config']['preferred-install'];
2021

2122
foreach ($dirs as $k => $dir) {
2223
if (!system("git diff --name-only $mergeBase -- $dir", $exitStatus)) {
@@ -42,7 +43,12 @@
4243
$json = rtrim(json_encode(array('repositories' => $package->repositories), $flags), "\n}").','.substr($json, 1);
4344
file_put_contents($dir.'/composer.json', $json);
4445
}
45-
passthru("cd $dir && tar -cf package.tar --exclude='package.tar' *");
46+
47+
if (isset($preferredInstall[$package->name]) && 'source' === $preferredInstall[$package->name]) {
48+
passthru("cd $dir && tar -cf package.tar --exclude='package.tar' *");
49+
} else {
50+
passthru("cd $dir && git init && git add . && git commit -m - && git archive -o package.tar HEAD && rm .git/ -Rf");
51+
}
4652

4753
if (!isset($package->extra->{'branch-alias'}->{'dev-master'})) {
4854
echo "Missing \"dev-master\" branch-alias in composer.json extra.\n";

0 commit comments

Comments
 (0)
0