21
21
submodules : true
22
22
23
23
- name : " Build Driver"
24
- uses : ./.github/workflows /linux/build
24
+ uses : ./.github/actions /linux/build
25
25
with :
26
26
version : " 8.3"
27
27
@@ -38,27 +38,43 @@ jobs:
38
38
# PECL always uses the version for the package name.
39
39
# Read it from the version file and store in env to use when uploading artifacts
40
40
- name : " Read current package version"
41
- run : echo "PACKAGE_VERSION=$(./bin/update-release-version.php get-version)" >> "$GITHUB_ENV"
41
+ run : |
42
+ PACKAGE_VERSION=$(./bin/update-release-version.php get-version)
43
+ echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> "$GITHUB_ENV"
44
+ echo "PACKAGE_FILE=mongodb-${PACKAGE_VERSION}.tgz" >> "$GITHUB_ENV"
45
+
46
+ - name : " Create detached signature for PECL package"
47
+ uses : mongodb-labs/drivers-github-tools/garasign/gpg-sign@main
48
+ with :
49
+ filenames : ${{ env.PACKAGE_FILE }}
50
+ garasign_username : ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
51
+ garasign_password : ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
52
+ artifactory_username : ${{ secrets.ARTIFACTORY_USER }}
53
+ artifactory_password : ${{ secrets.ARTIFACTORY_PASSWORD }}
42
54
43
55
- name : " Install release archive to verify correctness"
44
- run : sudo pecl install mongodb- ${{ env.PACKAGE_VERSION }}.tgz
56
+ run : sudo pecl install ${{ env.PACKAGE_FILE }}
45
57
46
- - name : " Upload artifact "
58
+ - name : " Upload artifacts "
47
59
uses : actions/upload-artifact@v4
48
60
with :
49
- name : mongodb-${{ env.PACKAGE_VERSION }}.tgz
50
- path : mongodb-${{ env.PACKAGE_VERSION }}.tgz
61
+ name : ${{ env.PACKAGE_FILE }}
62
+ path : |
63
+ ${{ env.PACKAGE_FILE }}
64
+ ${{ env.PACKAGE_FILE }}.sig
51
65
retention-days : 3
52
66
53
- - name : " Upload release artifact "
54
- run : gh release upload ${{ github.ref_name }} mongodb- ${{ env.PACKAGE_VERSION }}.tgz
67
+ - name : " Upload release artifacts "
68
+ run : gh release upload ${{ github.ref_name }} ${{ env.PACKAGE_FILE }} ${{ env.PACKAGE_FILE }}.sig
55
69
continue-on-error : true
56
70
env :
57
71
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
58
72
59
73
build-windows :
60
74
name : " Create Windows package"
61
- runs-on : windows-2022
75
+ # windows-latest is required to use enableCrossOsArchive with Ubuntu in the
76
+ # next step. See https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cross-os-cache
77
+ runs-on : windows-latest
62
78
defaults :
63
79
run :
64
80
shell : cmd
78
94
79
95
- name : " Build Driver"
80
96
id : build-driver
81
- uses : ./.github/workflows /windows/build
97
+ uses : ./.github/actions /windows/build
82
98
with :
83
99
version : ${{ matrix.php }}
84
100
arch : ${{ matrix.arch }}
@@ -91,20 +107,73 @@ jobs:
91
107
env :
92
108
BUILD_DIR : ${{ steps.build-driver.outputs.build-dir }}
93
109
110
+ - name : " Cache build artifacts for subsequent builds"
111
+ uses : actions/cache/save@v4
112
+ with :
113
+ key : ${{ github.sha }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }}
114
+ enableCrossOsArchive : true
115
+ path : |
116
+ php_mongodb.dll
117
+ php_mongodb.pdb
118
+
119
+ sign-and-publish-windows :
120
+ name : " Sign and Publish Windows package"
121
+ needs : [build-windows]
122
+ # ubuntu-latest is required to use enableCrossOsArchive
123
+ # See https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cross-os-cache
124
+ runs-on : " ubuntu-latest"
125
+
126
+ strategy :
127
+ fail-fast : false
128
+ matrix :
129
+ # Note: keep this in sync with the Windows matrix in windows-tests.yml
130
+ php : [ "7.4", "8.0", "8.1", "8.2", "8.3" ]
131
+ arch : [ x64, x86 ]
132
+ ts : [ ts, nts ]
133
+
134
+ steps :
135
+ - uses : actions/checkout@v4
136
+
137
+ - name : Restore cached build artifacts
138
+ id : cache-build-artifacts
139
+ uses : actions/cache/restore@v4
140
+ with :
141
+ fail-on-cache-miss : true
142
+ key : ${{ github.sha }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }}
143
+ enableCrossOsArchive : true
144
+ path : |
145
+ php_mongodb.dll
146
+ php_mongodb.pdb
147
+
148
+ - name : " Create detached DLL signature"
149
+ uses : mongodb-labs/drivers-github-tools/garasign/gpg-sign@main
150
+ with :
151
+ filenames : php_mongodb.dll
152
+ garasign_username : ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
153
+ garasign_password : ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
154
+ artifactory_username : ${{ secrets.ARTIFACTORY_USER }}
155
+ artifactory_password : ${{ secrets.ARTIFACTORY_PASSWORD }}
156
+
94
157
- name : " Upload DLL and PDB files as build artifacts"
95
158
uses : actions/upload-artifact@v4
96
159
with :
97
160
name : php_mongodb-${{ github.ref_name }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }}
98
161
path : |
99
162
php_mongodb.dll
163
+ php_mongodb.dll.sig
100
164
php_mongodb.pdb
165
+ CREDITS
166
+ CONTRIBUTING.md
167
+ LICENSE
168
+ README.md
169
+ THIRD_PARTY_NOTICES
101
170
retention-days : 3
102
171
103
172
- name : " Create and upload release artifact"
104
173
run : |
105
- set ARCHIVE=php_mongodb-${{ github.ref_name }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }}.zip
106
- zip % ARCHIVE% php_mongodb.dll php_mongodb.pdb CREDITS CONTRIBUTING.md LICENSE README.md THIRD_PARTY_NOTICES
107
- gh release upload ${{ github.ref_name }} % ARCHIVE%
174
+ ARCHIVE=php_mongodb-${{ github.ref_name }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }}.zip
175
+ zip ${ ARCHIVE} php_mongodb.dll php_mongodb.dll.sig php_mongodb.pdb CREDITS CONTRIBUTING.md LICENSE README.md THIRD_PARTY_NOTICES
176
+ gh release upload ${{ github.ref_name }} ${ ARCHIVE}
108
177
continue-on-error : true
109
178
env :
110
179
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments