diff --git a/.github/actions/windows/build/action.yml b/.github/actions/windows/build/action.yml index e32153426..1075eb1b9 100644 --- a/.github/actions/windows/build/action.yml +++ b/.github/actions/windows/build/action.yml @@ -11,6 +11,9 @@ inputs: description: "Thread-safety (nts or ts)" required: true outputs: + vs: + description: "The Visual Studio version" + value: ${{ steps.prepare-build-env.outputs.vs }} build-dir: description: "The build directory to be used" value: ${{ steps.prepare-build-env.outputs.build-dir }} diff --git a/.github/actions/windows/prepare-build/action.yml b/.github/actions/windows/prepare-build/action.yml index 847180078..fb1c2a1e8 100644 --- a/.github/actions/windows/prepare-build/action.yml +++ b/.github/actions/windows/prepare-build/action.yml @@ -11,6 +11,9 @@ inputs: description: "Thread-safety (nts or ts)" required: true outputs: + vs: + description: "The Visual Studio version" + value: ${{steps.setup-php.outputs.vs}} build-dir: description: "The build directory to be used" value: ${{steps.get-build-dir.outputs.build_dir}} diff --git a/.github/workflows/build-windows-package.yml b/.github/workflows/build-windows-package.yml index a867c7d9a..8b59b18bf 100644 --- a/.github/workflows/build-windows-package.yml +++ b/.github/workflows/build-windows-package.yml @@ -38,6 +38,8 @@ jobs: defaults: run: shell: cmd + outputs: + vs: ${{ steps.build-driver.outputs.vs }} steps: - uses: actions/checkout@v4 @@ -110,31 +112,22 @@ jobs: with: filenames: php_mongodb.dll - # Copy the signature file from the release asset directory to avoid directory issues in the ZIP file - - name: "Copy signature file" - run: cp ${RELEASE_ASSETS}/php_mongodb.dll.sig . + - name: "Generate file name for DLL and archive" + run: + echo FILENAME="php_mongodb-${{ inputs.version }}-${{ inputs.php }}-${{ inputs.ts }}-${{ needs.build.outputs.vs }}-${{ inputs.arch == 'x64' && 'x64_86' || inputs.arch }}" >> "$GITHUB_ENV" - - name: "Set compiler environment variable" + # In this step, we: + # - update the extension DLL file name to match the expectation of pie + # - copy the signature file from the release asset directory to avoid directory issues in the archive + # - rename the signature file to match the extension DLL file + - name: "Copy signature file and use correct file names" run: | - case "$PHP_VERSION" in - "7.4") - COMPILER="vc15" - ;; - "8.0" | "8.1" | "8.2" | "8.3") - COMPILER="vs16" - ;; - "8.4") - COMPILER="vs17" - ;; - esac - echo "COMPILER=${COMPILER}" >> "$GITHUB_ENV" - shell: bash - env: - PHP_VERSION: ${{ inputs.php }} + mv php_mongodb.dll ${{ env.FILENAME }}.dll + cp ${RELEASE_ASSETS}/php_mongodb.dll.sig ${{ env.FILENAME }}.dll.sig - name: "Create and upload release asset" if: ${{ inputs.upload_release_asset }} run: | - ARCHIVE=php_mongodb-${{ inputs.version }}-${{ inputs.php }}-${{ inputs.ts }}-${{ env.COMPILER }}-${{ inputs.arch }}.zip - zip ${ARCHIVE} php_mongodb.dll php_mongodb.dll.sig php_mongodb.pdb CREDITS CONTRIBUTING.md LICENSE README.md THIRD_PARTY_NOTICES + ARCHIVE=${{ env.FILENAME }}.zip + zip ${ARCHIVE} ${{ env.FILENAME }}.dll ${{ env.FILENAME }}.dll.sig php_mongodb.pdb CREDITS CONTRIBUTING.md LICENSE README.md THIRD_PARTY_NOTICES gh release upload ${{ inputs.version }} ${ARCHIVE}