Skip to content

Commit ee842d8

Browse files
authored
fix
1 parent 7c8e3e2 commit ee842d8

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/build-php.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ jobs:
3737
git checkout main
3838
cd ../php-bin
3939
40+
- shell: bash
41+
run: |
42+
PHP_VERSION=$(echo "${{ matrix.version }}" | cut -d. -f1,2)
43+
echo "PHP_VERSION=$PHP_VERSION" >> $GITHUB_ENV
44+
4045
- shell: bash
4146
run: echo "SPC_BUILD_ARCH=x64" >> $GITHUB_ENV
4247

@@ -119,16 +124,21 @@ jobs:
119124
./bin/spc build --build-cli "${{ env.PHP_EXTENSIONS }}"
120125
cd ../php-bin
121126
127+
- shell: bash
128+
run: |
129+
PHP_VERSION_FULL=$(php -r "echo PHP_VERSION;")
130+
echo "PHP_VERSION_FULL=$PHP_VERSION_FULL" >> $GITHUB_ENV
131+
122132
- name: Zip PHP binary, copy metadata
123133
shell: bash
124134
run: |
125135
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
126-
powershell Compress-Archive -Path "../static-php-cli/buildroot/bin/php.exe" -DestinationPath "bin/${{ env.SPC_BUILD_OS }}/${{ env.SPC_BUILD_ARCH }}/php-${{ matrix.version }}.zip"
136+
powershell Compress-Archive -Path "../static-php-cli/buildroot/bin/php.exe" -DestinationPath "bin/${{ env.SPC_BUILD_OS }}/${{ env.SPC_BUILD_ARCH }}/php-${{ env.PHP_VERSION }}.zip" -Force
127137
else
128138
mkdir -p tmp-bin
129139
cp ../static-php-cli/buildroot/bin/php tmp-bin/
130140
cd tmp-bin
131-
zip ../bin/${{ env.SPC_BUILD_OS }}/${{ env.SPC_BUILD_ARCH }}/php-${{ matrix.version }}.zip php
141+
zip ../bin/${{ env.SPC_BUILD_OS }}/${{ env.SPC_BUILD_ARCH }}/php-${{ env.PHP_VERSION }}.zip php
132142
cd ..
133143
rm -rf tmp-bin
134144
fi
@@ -139,11 +149,11 @@ jobs:
139149
- name: Create Pull Request
140150
uses: peter-evans/create-pull-request@v7
141151
with:
142-
branch: update-php-${{ matrix.version }}-${{ env.SPC_BUILD_OS }}-${{ env.SPC_BUILD_ARCH }}
143-
title: "Update PHP ${{ matrix.version }} build for ${{ env.SPC_BUILD_OS }} ${{ env.SPC_BUILD_ARCH }}"
152+
branch: update-php-${{ env.PHP_VERSION }}-${{ env.SPC_BUILD_OS }}-${{ env.SPC_BUILD_ARCH }}
153+
title: "Update PHP ${{ env.PHP_VERSION }} build for ${{ env.SPC_BUILD_OS }} ${{ env.SPC_BUILD_ARCH }}"
144154
commit-message: "build"
145155
body: |
146-
PHP: ${{ matrix.version }}
156+
PHP: ${{ env.PHP_VERSION_FULL }}
147157
Exts: ${{ env.PHP_EXTENSIONS }}
148158
OS: ${{ env.SPC_BUILD_OS }}
149159
Arch: ${{ env.SPC_BUILD_ARCH }}

0 commit comments

Comments
 (0)