Skip to content

Commit 90dcfcd

Browse files
committed
build from packages directory, not from vendor
1 parent af370d9 commit 90dcfcd

File tree

8 files changed

+27
-22
lines changed

8 files changed

+27
-22
lines changed

.github/workflows/build-apk-forgejo.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ jobs:
143143

144144
- name: Extract with permissions
145145
run: |
146-
mkdir -p vendor/crazywhalecc/static-php-cli/downloads
147-
tar -xzf downloads.tar.gz -C vendor/crazywhalecc/static-php-cli/downloads
146+
mkdir -p downloads
147+
tar -xzf downloads.tar.gz -C downloads
148148
rm downloads.tar.gz
149149
150150
- name: Build PHP packages
@@ -169,7 +169,7 @@ jobs:
169169
uses: actions/upload-artifact@v4
170170
with:
171171
name: build-logs-${{ matrix.arch }}-php${{ matrix.php-version }}
172-
path: vendor/crazywhalecc/static-php-cli/log
172+
path: log
173173

174174
- name: Setup tmate session
175175
if: ${{ failure() && inputs.debug_tmate == true }}

.github/workflows/build-deb-forgejo.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ jobs:
153153

154154
- name: Extract with permissions
155155
run: |
156-
mkdir -p vendor/crazywhalecc/static-php-cli/downloads
157-
tar -xzf downloads.tar.gz -C vendor/crazywhalecc/static-php-cli/downloads
156+
mkdir -p downloads
157+
tar -xzf downloads.tar.gz -C downloads
158158
rm downloads.tar.gz
159159
160160
- name: Build PHP packages
@@ -179,7 +179,7 @@ jobs:
179179
uses: actions/upload-artifact@v4
180180
with:
181181
name: build-logs-${{ matrix.arch }}-php${{ matrix.php-version }}
182-
path: vendor/crazywhalecc/static-php-cli/log
182+
path: log
183183

184184
- name: Install tmate
185185
if: ${{ failure() && inputs.debug_tmate == true }}

.github/workflows/build-gcc-deb-packages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ jobs:
8989

9090
- name: Extract with permissions
9191
run: |
92-
mkdir -p vendor/crazywhalecc/static-php-cli/downloads
93-
tar -xzf downloads.tar.gz -C vendor/crazywhalecc/static-php-cli/downloads
92+
mkdir -p downloads
93+
tar -xzf downloads.tar.gz -C downloads
9494
rm downloads.tar.gz
9595
9696
- name: Build PHP
@@ -197,7 +197,7 @@ jobs:
197197
uses: actions/upload-artifact@v4
198198
with:
199199
name: build-logs-${{ matrix.arch }}-php${{ matrix.php-version }}
200-
path: vendor/crazywhalecc/static-php-cli/log
200+
path: log
201201

202202
- name: Setup tmate session
203203
if: ${{ failure() && inputs.debug_tmate == true }}

.github/workflows/build-rpm-modular-packages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ jobs:
228228

229229
- name: Extract with permissions
230230
run: |
231-
mkdir -p vendor/crazywhalecc/static-php-cli/downloads
232-
tar -xzf downloads.tar.gz -C vendor/crazywhalecc/static-php-cli/downloads
231+
mkdir -p downloads
232+
tar -xzf downloads.tar.gz -C downloads
233233
rm downloads.tar.gz
234234
235235
- name: Build PHP
@@ -299,7 +299,7 @@ jobs:
299299
uses: actions/upload-artifact@v4
300300
with:
301301
name: build-logs-${{ matrix.arch }}-el${{ matrix.alma }}-php${{ matrix.php-version }}
302-
path: vendor/crazywhalecc/static-php-cli/log
302+
path: log
303303

304304
- name: Setup tmate session
305305
if: ${{ failure() && inputs.debug_tmate == true }}

.github/workflows/build-zig-packages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ jobs:
116116

117117
- name: Extract with permissions
118118
run: |
119-
mkdir -p vendor/crazywhalecc/static-php-cli/downloads
120-
tar -xzf downloads.tar.gz -C vendor/crazywhalecc/static-php-cli/downloads
119+
mkdir -p downloads
120+
tar -xzf downloads.tar.gz -C downloads
121121
rm downloads.tar.gz
122122
123123
- name: Build PHP and packages
@@ -189,7 +189,7 @@ jobs:
189189
uses: actions/upload-artifact@v4
190190
with:
191191
name: build-logs-${{ matrix.arch }}-el7-php${{ matrix.php-version }}
192-
path: vendor/crazywhalecc/static-php-cli/log
192+
path: log
193193

194194
- name: Setup tmate session
195195
if: ${{ failure() && inputs.debug_tmate == true }}

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/build/
2-
/download/
2+
/downloads/
3+
/buildroot/
4+
/pkgroot/
5+
/source/
6+
/log/
37
/vendor/
48
/.idea
59
/dist
10+
craft.yml

src/package/devel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function getFpmConfig(): array
1919
$phpConfigContent = file_get_contents($phpConfigPath);
2020

2121
// Replace buildroot paths with BUILD_ROOT_PATH
22-
$builtDir = BASE_PATH . '/vendor/crazywhalecc/static-php-cli/buildroot';
22+
$builtDir = BASE_PATH . '/buildroot';
2323
$phpConfigContent = str_replace($builtDir, BUILD_ROOT_PATH, $phpConfigContent);
2424
$phpConfigContent = str_replace('/app/buildroot', BUILD_ROOT_PATH, $phpConfigContent);
2525

src/step/RunSPC.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ class RunSPC
1010
{
1111
public static function run(bool $debug = false, string $phpVersion = '8.4', ?array $packages = null): bool
1212
{
13-
$craftYmlDest = BASE_PATH . '/vendor/crazywhalecc/static-php-cli/craft.yml';
13+
$craftYmlDest = BASE_PATH . '/craft.yml';
1414

1515
// Render the template using the TwigRenderer
1616
try {
1717
$craftYml = TwigRenderer::renderCraftTemplate($phpVersion, null, $packages);
1818

1919
// Write the rendered craft.yml to the destination
2020
if (!file_put_contents($craftYmlDest, $craftYml)) {
21-
echo "Failed to write updated craft.yml to static-php-cli vendor directory.\n";
21+
echo "Failed to write updated craft.yml to project root.\n";
2222
return false;
2323
}
2424
} catch (\Exception $e) {
@@ -27,12 +27,12 @@ public static function run(bool $debug = false, string $phpVersion = '8.4', ?arr
2727
}
2828

2929
// Build the command arguments
30-
$args = ['bin/spc', 'craft'];
30+
$args = ['vendor/bin/spc', 'craft'];
3131
if ($debug) {
3232
$args[] = '--debug';
3333
}
3434

35-
$process = new Process($args, BASE_PATH . '/vendor/crazywhalecc/static-php-cli', env: ['CI' => true]);
35+
$process = new Process($args, BASE_PATH, env: ['CI' => true]);
3636
$process->setTimeout(null);
3737
if (Process::isTtySupported()) {
3838
$process->setTty(true); // Interactive mode
@@ -59,7 +59,7 @@ public static function run(bool $debug = false, string $phpVersion = '8.4', ?arr
5959
private static function copyBuiltFiles(string $phpVersion): void
6060
{
6161
// Copy the built PHP binaries to our build directory
62-
$sourceDir = BASE_PATH . '/vendor/crazywhalecc/static-php-cli/buildroot';
62+
$sourceDir = BASE_PATH . '/buildroot';
6363
$buildDir = BUILD_ROOT_PATH;
6464
$baseBuildDir = BASE_PATH . '/build';
6565

0 commit comments

Comments
 (0)