Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions .github/actions/windows/build/action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: "Build DLL files for Windows"
description: "Prepares the PHP build environment for the MongoDB driver"
inputs:
version:
ref:
description: Git reference to build
required: false
php-version:
description: "PHP version to build for"
required: true
arch:
Expand All @@ -10,24 +13,22 @@ inputs:
ts:
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 }}
run-tests:
description: "Whether to run tests after building"
required: false
default: "false"
runs:
using: composite
steps:
- name: Prepare build environment
id: prepare-build-env
uses: ./.github/actions/windows/prepare-build
- name: Build extension
uses: php/php-windows-builder/extension@1.6.0
with:
version: ${{ inputs.version }}
extension-ref: ${{ inputs.ref }}
php-version: ${{ inputs.php-version }}
arch: ${{ inputs.arch }}
ts: ${{ inputs.ts }}

- name: Build driver
shell: cmd
run: nmake /nologo
run-tests: ${{ inputs.run-tests == 'true' && true || false }}
test-runner-args: "--show-diff"
args: "--enable-mongodb --with-mongodb-sasl=yes --with-mongodb-client-side-encryption=yes"
libs: "openssl"
test-workers: 1
58 changes: 0 additions & 58 deletions .github/actions/windows/prepare-build/action.yml

This file was deleted.

134 changes: 0 additions & 134 deletions .github/workflows/build-windows-package.yml

This file was deleted.

100 changes: 100 additions & 0 deletions .github/workflows/build-windows-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: "Build Windows Packages"
run-name: "Build Windows Packages for ${{ inputs.ref }}"

on:
workflow_call:
inputs:
version:
description: "The version being built"
type: string
required: true
ref:
description: "The git reference to build"
type: string
required: true
upload_release_assets:
description: "Whether to upload assets to a GitHub release"
type: boolean
default: false

jobs:
build:
name: "Build DLL"
runs-on: ${{ matrix.os }}
defaults:
run:
shell: cmd

strategy:
fail-fast: false
matrix:
os: [ "windows-2022" ]
# Note: keep this in sync with the Windows matrix in tests.yml
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
- "8.5"
arch: [ x64, x86 ]
ts: [ ts, nts ]

steps:
- uses: actions/checkout@v6
with:
submodules: true
ref: ${{ inputs.ref }}

- name: "Build Driver"
id: build-driver
uses: ./.github/actions/windows/build
with:
ref: ${{ inputs.ref }}
php-version: ${{ matrix.php-version }}
arch: ${{ matrix.arch }}
ts: ${{ matrix.ts }}
run-tests: false

sign-and-upload:
environment: release
name: "Sign and create package"
needs: build
runs-on: "ubuntu-latest"
permissions:
id-token: write

steps:
- name: "Generate token and checkout repository"
uses: mongodb-labs/drivers-github-tools/secure-checkout@v3
with:
app_id: ${{ vars.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
ref: ${{ inputs.ref }}

- name: "Set up drivers-github-tools"
uses: mongodb-labs/drivers-github-tools/setup@v3
with:
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
aws_region_name: ${{ vars.AWS_REGION_NAME }}
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}

- name: Get artifacts
uses: actions/download-artifact@v5
with:
path: artifacts
pattern: php_mongodb-*.zip
merge-multiple: true

- name: "Create detached signatures for packages"
uses: mongodb-labs/drivers-github-tools/gpg-sign@v3
with:
filenames: php_mongodb*.zip

- name: "Move signatures from release assets folder"
run: |
mv ${RELEASE_ASSETS}/php_mongodb*.sig artifacts/

- name: "Upload assets to release"
if: ${{ inputs.upload_release_assets }}
run: |
gh release upload ${{ inputs.version }} artifacts/php_mongodb* --clobber
14 changes: 2 additions & 12 deletions .github/workflows/package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,9 @@ jobs:

build-windows:
name: "Create Windows packages"
uses: ./.github/workflows/build-windows-package.yml
uses: ./.github/workflows/build-windows-packages.yml
with:
version: ${{ inputs.version }}
ref: refs/tags/${{ inputs.version }}
php: ${{ matrix.php }}
arch: ${{ matrix.arch }}
ts: ${{ matrix.ts }}
upload_release_asset: true
upload_release_assets: true
secrets: inherit
strategy:
fail-fast: false
matrix:
# Note: keep this in sync with the Windows matrix in tests.yml
php: [ "8.1", "8.2", "8.3", "8.4", "8.5" ]
arch: [ x64, x86 ]
ts: [ ts, nts ]
Loading
Loading