2121 submodules : true
2222
2323 - name : " Build Driver"
24- uses : ./.github/workflows /linux/build
24+ uses : ./.github/actions /linux/build
2525 with :
2626 version : " 8.3"
2727
@@ -38,27 +38,43 @@ jobs:
3838 # PECL always uses the version for the package name.
3939 # Read it from the version file and store in env to use when uploading artifacts
4040 - 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 }}
4254
4355 - 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 }}
4557
46- - name : " Upload artifact "
58+ - name : " Upload artifacts "
4759 uses : actions/upload-artifact@v4
4860 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
5165 retention-days : 3
5266
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
5569 continue-on-error : true
5670 env :
5771 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5872
5973 build-windows :
6074 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
6278 defaults :
6379 run :
6480 shell : cmd
7894
7995 - name : " Build Driver"
8096 id : build-driver
81- uses : ./.github/workflows /windows/build
97+ uses : ./.github/actions /windows/build
8298 with :
8399 version : ${{ matrix.php }}
84100 arch : ${{ matrix.arch }}
@@ -91,20 +107,73 @@ jobs:
91107 env :
92108 BUILD_DIR : ${{ steps.build-driver.outputs.build-dir }}
93109
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+
94157 - name : " Upload DLL and PDB files as build artifacts"
95158 uses : actions/upload-artifact@v4
96159 with :
97160 name : php_mongodb-${{ github.ref_name }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }}
98161 path : |
99162 php_mongodb.dll
163+ php_mongodb.dll.sig
100164 php_mongodb.pdb
165+ CREDITS
166+ CONTRIBUTING.md
167+ LICENSE
168+ README.md
169+ THIRD_PARTY_NOTICES
101170 retention-days : 3
102171
103172 - name : " Create and upload release artifact"
104173 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}
108177 continue-on-error : true
109178 env :
110179 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments