Skip to content

Commit 4d81514

Browse files
authored
PHPC-2649: Use output from setup-php-sdk in packaging step (#1732)
* Use compiler name output from setup-php-sdk action in packaging step * Fix wrong name for x64 packages * Use correct name for DLL file to fix pie installs
1 parent ef4a6e8 commit 4d81514

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

.github/actions/windows/build/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ inputs:
1111
description: "Thread-safety (nts or ts)"
1212
required: true
1313
outputs:
14+
vs:
15+
description: "The Visual Studio version"
16+
value: ${{ steps.prepare-build-env.outputs.vs }}
1417
build-dir:
1518
description: "The build directory to be used"
1619
value: ${{ steps.prepare-build-env.outputs.build-dir }}

.github/actions/windows/prepare-build/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ inputs:
1111
description: "Thread-safety (nts or ts)"
1212
required: true
1313
outputs:
14+
vs:
15+
description: "The Visual Studio version"
16+
value: ${{steps.setup-php.outputs.vs}}
1417
build-dir:
1518
description: "The build directory to be used"
1619
value: ${{steps.get-build-dir.outputs.build_dir}}

.github/workflows/build-windows-package.yml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
defaults:
3939
run:
4040
shell: cmd
41+
outputs:
42+
vs: ${{ steps.build-driver.outputs.vs }}
4143

4244
steps:
4345
- uses: actions/checkout@v4
@@ -110,31 +112,22 @@ jobs:
110112
with:
111113
filenames: php_mongodb.dll
112114

113-
# Copy the signature file from the release asset directory to avoid directory issues in the ZIP file
114-
- name: "Copy signature file"
115-
run: cp ${RELEASE_ASSETS}/php_mongodb.dll.sig .
115+
- name: "Generate file name for DLL and archive"
116+
run:
117+
echo FILENAME="php_mongodb-${{ inputs.version }}-${{ inputs.php }}-${{ inputs.ts }}-${{ needs.build.outputs.vs }}-${{ inputs.arch == 'x64' && 'x64_86' || inputs.arch }}" >> "$GITHUB_ENV"
116118

117-
- name: "Set compiler environment variable"
119+
# In this step, we:
120+
# - update the extension DLL file name to match the expectation of pie
121+
# - copy the signature file from the release asset directory to avoid directory issues in the archive
122+
# - rename the signature file to match the extension DLL file
123+
- name: "Copy signature file and use correct file names"
118124
run: |
119-
case "$PHP_VERSION" in
120-
"7.4")
121-
COMPILER="vc15"
122-
;;
123-
"8.0" | "8.1" | "8.2" | "8.3")
124-
COMPILER="vs16"
125-
;;
126-
"8.4")
127-
COMPILER="vs17"
128-
;;
129-
esac
130-
echo "COMPILER=${COMPILER}" >> "$GITHUB_ENV"
131-
shell: bash
132-
env:
133-
PHP_VERSION: ${{ inputs.php }}
125+
mv php_mongodb.dll ${{ env.FILENAME }}.dll
126+
cp ${RELEASE_ASSETS}/php_mongodb.dll.sig ${{ env.FILENAME }}.dll.sig
134127
135128
- name: "Create and upload release asset"
136129
if: ${{ inputs.upload_release_asset }}
137130
run: |
138-
ARCHIVE=php_mongodb-${{ inputs.version }}-${{ inputs.php }}-${{ inputs.ts }}-${{ env.COMPILER }}-${{ inputs.arch }}.zip
139-
zip ${ARCHIVE} php_mongodb.dll php_mongodb.dll.sig php_mongodb.pdb CREDITS CONTRIBUTING.md LICENSE README.md THIRD_PARTY_NOTICES
131+
ARCHIVE=${{ env.FILENAME }}.zip
132+
zip ${ARCHIVE} ${{ env.FILENAME }}.dll ${{ env.FILENAME }}.dll.sig php_mongodb.pdb CREDITS CONTRIBUTING.md LICENSE README.md THIRD_PARTY_NOTICES
140133
gh release upload ${{ inputs.version }} ${ARCHIVE}

0 commit comments

Comments
 (0)