Skip to content

Commit 4602499

Browse files
Merge v1.21 into v2.1 (#1909)
2 parents 4403254 + 7d64e0d commit 4602499

9 files changed

Lines changed: 164 additions & 337 deletions

File tree

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: "Build DLL files for Windows"
22
description: "Prepares the PHP build environment for the MongoDB driver"
33
inputs:
4-
version:
4+
ref:
5+
description: Git reference to build
6+
required: false
7+
php-version:
58
description: "PHP version to build for"
69
required: true
710
arch:
@@ -10,24 +13,22 @@ inputs:
1013
ts:
1114
description: "Thread-safety (nts or ts)"
1215
required: true
13-
outputs:
14-
vs:
15-
description: "The Visual Studio version"
16-
value: ${{ steps.prepare-build-env.outputs.vs }}
17-
build-dir:
18-
description: "The build directory to be used"
19-
value: ${{ steps.prepare-build-env.outputs.build-dir }}
16+
run-tests:
17+
description: "Whether to run tests after building"
18+
required: false
19+
default: "false"
2020
runs:
2121
using: composite
2222
steps:
23-
- name: Prepare build environment
24-
id: prepare-build-env
25-
uses: ./.github/actions/windows/prepare-build
23+
- name: Build extension
24+
uses: php/php-windows-builder/extension@1.6.0
2625
with:
27-
version: ${{ inputs.version }}
26+
extension-ref: ${{ inputs.ref }}
27+
php-version: ${{ inputs.php-version }}
2828
arch: ${{ inputs.arch }}
2929
ts: ${{ inputs.ts }}
30-
31-
- name: Build driver
32-
shell: cmd
33-
run: nmake /nologo
30+
run-tests: ${{ inputs.run-tests == 'true' && true || false }}
31+
test-runner-args: "--show-diff"
32+
args: "--enable-mongodb --with-mongodb-sasl=yes --with-mongodb-client-side-encryption=yes"
33+
libs: "openssl"
34+
test-workers: 1

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

Lines changed: 0 additions & 57 deletions
This file was deleted.

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

Lines changed: 0 additions & 134 deletions
This file was deleted.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: "Build Windows Packages"
2+
run-name: "Build Windows Packages for ${{ inputs.ref }}"
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
version:
8+
description: "The version being built"
9+
type: string
10+
required: true
11+
ref:
12+
description: "The git reference to build"
13+
type: string
14+
required: true
15+
upload_release_assets:
16+
description: "Whether to upload assets to a GitHub release"
17+
type: boolean
18+
default: false
19+
20+
jobs:
21+
build:
22+
name: "Build DLL"
23+
runs-on: ${{ matrix.os }}
24+
defaults:
25+
run:
26+
shell: cmd
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
os: [ "windows-2022" ]
32+
# Note: keep this in sync with the Windows matrix in tests.yml
33+
php-version:
34+
- "8.1"
35+
- "8.2"
36+
- "8.3"
37+
- "8.4"
38+
- "8.5"
39+
arch: [ x64, x86 ]
40+
ts: [ ts, nts ]
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
with:
45+
submodules: true
46+
ref: ${{ inputs.ref }}
47+
48+
- name: "Build Driver"
49+
id: build-driver
50+
uses: ./.github/actions/windows/build
51+
with:
52+
ref: ${{ inputs.ref }}
53+
php-version: ${{ matrix.php-version }}
54+
arch: ${{ matrix.arch }}
55+
ts: ${{ matrix.ts }}
56+
run-tests: false
57+
58+
sign-and-upload:
59+
environment: release
60+
name: "Sign and create package"
61+
needs: build
62+
runs-on: "ubuntu-latest"
63+
permissions:
64+
id-token: write
65+
66+
steps:
67+
- name: "Generate token and checkout repository"
68+
uses: mongodb-labs/drivers-github-tools/secure-checkout@v2
69+
with:
70+
app_id: ${{ vars.APP_ID }}
71+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
72+
ref: ${{ inputs.ref }}
73+
74+
- name: "Set up drivers-github-tools"
75+
uses: mongodb-labs/drivers-github-tools/setup@v2
76+
with:
77+
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
78+
aws_region_name: ${{ vars.AWS_REGION_NAME }}
79+
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
80+
81+
- name: Get artifacts
82+
uses: actions/download-artifact@v5
83+
with:
84+
path: artifacts
85+
pattern: php_mongodb-*.zip
86+
merge-multiple: true
87+
88+
- name: "Create detached signatures for packages"
89+
uses: mongodb-labs/drivers-github-tools/gpg-sign@v2
90+
with:
91+
filenames: php_mongodb*.zip
92+
93+
- name: "Move signatures from release assets folder"
94+
run: |
95+
mv ${RELEASE_ASSETS}/php_mongodb*.sig artifacts/
96+
97+
- name: "Upload assets to release"
98+
if: ${{ inputs.upload_release_assets }}
99+
run: |
100+
gh release upload ${{ inputs.version }} artifacts/php_mongodb* --clobber

.github/workflows/package-release.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,9 @@ jobs:
8585

8686
build-windows:
8787
name: "Create Windows packages"
88-
uses: ./.github/workflows/build-windows-package.yml
88+
uses: ./.github/workflows/build-windows-packages.yml
8989
with:
9090
version: ${{ inputs.version }}
9191
ref: refs/tags/${{ inputs.version }}
92-
php: ${{ matrix.php }}
93-
arch: ${{ matrix.arch }}
94-
ts: ${{ matrix.ts }}
95-
upload_release_asset: true
92+
upload_release_assets: true
9693
secrets: inherit
97-
strategy:
98-
fail-fast: false
99-
matrix:
100-
# Note: keep this in sync with the Windows matrix in tests.yml
101-
php: [ "8.1", "8.2", "8.3", "8.4", "8.5" ]
102-
arch: [ x64, x86 ]
103-
ts: [ ts, nts ]

0 commit comments

Comments
 (0)