8000 minor #33656 [travis] honor .gitattributes when building local packag… · symfony/symfony@6723e60 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6723e60

Browse files
minor #33656 [travis] honor .gitattributes when building local packages (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [travis] honor .gitattributes when building local packages | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- d7fbb0a [travis] honor .gitattributes when building local packages
2 parents 276f190 + d7fbb0a commit 6723e60

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