8
8
9
9
jobs :
10
10
build-pecl :
11
+ environment : release
11
12
name : " Create PECL package"
12
13
runs-on : " ubuntu-latest"
14
+ permissions :
15
+ id-token : write
13
16
14
17
steps :
18
+ - name : " Create temporary app token"
19
+ uses : actions/create-github-app-token@v1
20
+ id : app-token
21
+ with :
22
+ app-id : ${{ vars.APP_ID }}
23
+ private-key : ${{ secrets.APP_PRIVATE_KEY }}
24
+
25
+ - name : " Store GitHub token in environment"
26
+ run : echo "GH_TOKEN=${{ steps.app-token.outputs.token }}" >> "$GITHUB_ENV"
27
+ shell : bash
28
+
15
29
- name : " Checkout"
16
30
uses : " actions/checkout@v4"
17
31
with :
20
34
ref : ${{ github.ref }}
21
35
submodules : true
22
36
37
+ - name : " Set up drivers-github-tools"
38
+ uses : mongodb-labs/drivers-github-tools/setup@v2
39
+ with :
40
+ aws_role_arn : ${{ secrets.AWS_ROLE_ARN }}
41
+ aws_region_name : ${{ vars.AWS_REGION_NAME }}
42
+ aws_secret_id : ${{ secrets.AWS_SECRET_ID }}
43
+
23
44
- name : " Build Driver"
24
45
uses : ./.github/actions/linux/build
25
46
with :
@@ -44,17 +65,18 @@ jobs:
44
65
echo "PACKAGE_FILE=mongodb-${PACKAGE_VERSION}.tgz" >> "$GITHUB_ENV"
45
66
46
67
- name : " Create detached signature for PECL package"
47
- uses : mongodb-labs/drivers-github-tools/garasign/ gpg-sign@v1
68
+ uses : mongodb-labs/drivers-github-tools/gpg-sign@v2
48
69
with :
49
70
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 }}
54
71
55
72
- name : " Install release archive to verify correctness"
56
73
run : sudo pecl install ${{ env.PACKAGE_FILE }}
57
74
75
+ # Copy the signature file from the release asset directory to avoid directory issues in the ZIP file
76
+ # This can be removed once we're no longer uploading build artifacts
77
+ - name : " Copy signature file"
78
+ run : cp ${RELEASE_ASSETS}/${{ env.PACKAGE_FILE }}.sig .
79
+
58
80
- name : " Upload artifacts"
59
81
uses : actions/upload-artifact@v4
60
82
with :
67
89
- name : " Upload release artifacts"
68
90
run : gh release upload ${{ github.ref_name }} ${{ env.PACKAGE_FILE }} ${{ env.PACKAGE_FILE }}.sig
69
91
continue-on-error : true
70
- env :
71
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
72
92
73
93
build-windows :
74
94
name : " Create Windows package"
@@ -117,11 +137,14 @@ jobs:
117
137
php_mongodb.pdb
118
138
119
139
sign-and-publish-windows :
140
+ environment : release
120
141
name : " Sign and Publish Windows package"
121
142
needs : [build-windows]
122
143
# ubuntu-latest is required to use enableCrossOsArchive
123
144
# See https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cross-os-cache
124
145
runs-on : " ubuntu-latest"
146
+ permissions :
147
+ id-token : write
125
148
126
149
strategy :
127
150
fail-fast : false
@@ -132,8 +155,26 @@ jobs:
132
155
ts : [ ts, nts ]
133
156
134
157
steps :
158
+ - name : " Create temporary app token"
159
+ uses : actions/create-github-app-token@v1
160
+ id : app-token
161
+ with :
162
+ app-id : ${{ vars.APP_ID }}
163
+ private-key : ${{ secrets.APP_PRIVATE_KEY }}
164
+
165
+ - name : " Store GitHub token in environment"
166
+ run : echo "GH_TOKEN=${{ steps.app-token.outputs.token }}" >> "$GITHUB_ENV"
167
+ shell : bash
168
+
135
169
- uses : actions/checkout@v4
136
170
171
+ - name : " Set up drivers-github-tools"
172
+ uses : mongodb-labs/drivers-github-tools/setup@v2
173
+ with :
174
+ aws_role_arn : ${{ secrets.AWS_ROLE_ARN }}
175
+ aws_region_name : ${{ vars.AWS_REGION_NAME }}
176
+ aws_secret_id : ${{ secrets.AWS_SECRET_ID }}
177
+
137
178
- name : Restore cached build artifacts
138
179
id : cache-build-artifacts
139
180
uses : actions/cache/restore@v4
@@ -146,13 +187,13 @@ jobs:
146
187
php_mongodb.pdb
147
188
148
189
- name : " Create detached DLL signature"
149
- uses : mongodb-labs/drivers-github-tools/garasign/ gpg-sign@v1
190
+ uses : mongodb-labs/drivers-github-tools/gpg-sign@v2
150
191
with :
151
192
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 }}
193
+
194
+ # Copy the signature file from the release asset directory to avoid directory issues in the ZIP file
195
+ - name : " Copy signature file "
196
+ run : cp ${RELEASE_ASSETS}/php_mongodb.dll.sig .
156
197
157
198
- name : " Upload DLL and PDB files as build artifacts"
158
199
uses : actions/upload-artifact@v4
@@ -175,5 +216,3 @@ jobs:
175
216
zip ${ARCHIVE} php_mongodb.dll php_mongodb.dll.sig php_mongodb.pdb CREDITS CONTRIBUTING.md LICENSE README.md THIRD_PARTY_NOTICES
176
217
gh release upload ${{ github.ref_name }} ${ARCHIVE}
177
218
continue-on-error : true
178
- env :
179
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments