76
76
exit 1
77
77
fi
78
78
79
- - name : " Fail if branch names don't match"
80
- if : ${{ github.ref_name != env.RELEASE_BRANCH }}
81
- run : |
82
- echo '❌ Release failed due to branch mismatch: expected ${{ inputs.version }} to be released from ${{ env.RELEASE_BRANCH }}, got ${{ github.ref_name }}' >> $GITHUB_STEP_SUMMARY
83
- exit 1
84
-
85
79
#
86
80
# Preliminary checks done - commence the release process
87
81
#
93
87
aws_region_name : ${{ vars.AWS_REGION_NAME }}
94
88
aws_secret_id : ${{ secrets.AWS_SECRET_ID }}
95
89
96
- # Create a draft release with release message filled in
97
90
- name : " Prepare release message"
98
91
run : |
99
92
cat > release-message <<'EOL'
103
96
- name : " Create draft release"
104
97
run : echo "RELEASE_URL=$(gh release create ${{ inputs.version }} --target ${{ github.ref_name }} --title "${{ inputs.version }}" --notes-file release-message --draft)" >> "$GITHUB_ENV"
105
98
106
- # This step creates the signed release tag
107
99
- name : " Create release tag"
108
100
uses : mongodb-labs/drivers-github-tools/git-sign@v2
109
101
with :
@@ -119,11 +111,95 @@ jobs:
119
111
- name : " Push changes from release branch"
120
112
run : git push
121
113
122
- # Pushing the release tag starts build processes that then produce artifacts for the release
123
114
- name : " Push release tag"
124
115
run : git push origin ${{ inputs.version }}
125
116
126
117
- name : " Set summary"
127
118
run : |
128
119
echo '🚀 Created tag and drafted release for version [${{ inputs.version }}](${{ env.RELEASE_URL }})' >> $GITHUB_STEP_SUMMARY
129
120
echo '✍️ You may now update the release notes and publish the release when ready' >> $GITHUB_STEP_SUMMARY
121
+
122
+ static-analysis :
123
+ needs : prepare-release
124
+ name : " Run Static Analysis"
125
+ uses : ./.github/workflows/static-analysis.yml
126
+ with :
127
+ ref : refs/tags/${{ inputs.version }}
128
+ permissions :
129
+ security-events : write
130
+ id-token : write
131
+
132
+ publish-ssdlc-assets :
133
+ needs : static-analysis
134
+ environment : release
135
+ name : " Publish SSDLC Assets"
136
+ runs-on : ubuntu-latest
137
+ permissions :
138
+ security-events : read
139
+ id-token : write
140
+ contents : write
141
+
142
+ steps :
143
+ - name : " Create temporary app token"
144
+ uses : actions/create-github-app-token@v1
145
+ id : app-token
146
+ with :
147
+ app-id : ${{ vars.APP_ID }}
148
+ private-key : ${{ secrets.APP_PRIVATE_KEY }}
149
+
150
+ - name : " Store GitHub token in environment"
151
+ run : echo "GH_TOKEN=${{ steps.app-token.outputs.token }}" >> "$GITHUB_ENV"
152
+ shell : bash
153
+
154
+ - uses : actions/checkout@v4
155
+ with :
156
+ ref : refs/tags/${{ inputs.version }}
157
+ token : ${{ env.GH_TOKEN }}
158
+
159
+ - name : " Set up drivers-github-tools"
160
+ # TODO: Use main repository when https://github.com/mongodb-labs/drivers-github-tools/pull/25 is merged
161
+ uses : blink1073/drivers-github-tools/setup@add-compliance-report
162
+ with :
163
+ aws_role_arn : ${{ secrets.AWS_ROLE_ARN }}
164
+ aws_region_name : ${{ vars.AWS_REGION_NAME }}
165
+ aws_secret_id : ${{ secrets.AWS_SECRET_ID }}
166
+
167
+ - name : " Generate authorized publication document"
168
+ uses : mongodb-labs/drivers-github-tools/authorized-pub@v2
169
+ with :
170
+ product_name : " MongoDB PHP Driver (library)"
171
+ release_version : ${{ inputs.version }}
172
+ filenames : " "
173
+ token : ${{ env.GH_TOKEN }}
174
+
175
+ # TODO: Currently disabled as the asset group seems to no longer exist?
176
+ # - name: "Download SBOM file from Silk"
177
+ # uses: mongodb-labs/drivers-github-tools/sbom@v2
178
+ # with:
179
+ # silk_asset_group: mongodb-php-driver-library
180
+
181
+ # TODO: Currently disabled as the asset group seems to no longer exist?
182
+ # TODO: File name is only correct after https://github.com/mongodb-labs/drivers-github-tools/pull/25 is merged
183
+ # - name: "Upload SBOM as release artifact"
184
+ # run: gh release upload ${{ inputs.version }} ${{ env.S3_ASSETS }}/cyclonedx.sbom.json
185
+ # continue-on-error: true
186
+
187
+ - name : " Generate SARIF report from code scanning alerts"
188
+ # TODO: Use main repository when https://github.com/mongodb-labs/drivers-github-tools/pull/29 is merged
189
+ uses : alcaeus/drivers-github-tools/code-scanning-export@document-code-scanning-export
190
+ with :
191
+ ref : ${{ inputs.version }}
192
+ output-file : ${{ env.S3_ASSETS }}/code-scanning-alerts.json
193
+
194
+ - name : " Generate compliance report"
195
+ # TODO: Use main repository when https://github.com/mongodb-labs/drivers-github-tools/pull/25 is merged
196
+ uses : blink1073/drivers-github-tools/compliance-report@add-compliance-report
197
+ with :
198
+ token : ${{ env.GH_TOKEN }}
199
+
200
+ - name : Upload S3 assets
201
+ # TODO: Use main repository when https://github.com/mongodb-labs/drivers-github-tools/pull/30 is merged
202
+ uses : alcaeus/drivers-github-tools/upload-s3-assets@upload-s3-assets
203
+ with :
204
+ version : ${{ inputs.version }}
205
+ product_name : mongo-php-library
0 commit comments