Skip to content

Commit ff4ed67

Browse files
Merge v1.19 into master (#1343)
2 parents 42d5f61 + f173980 commit ff4ed67

File tree

3 files changed

+104
-22
lines changed

3 files changed

+104
-22
lines changed

.github/workflows/coding-standards.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,20 @@ jobs:
3535
# The -q option is required until phpcs v4 is released
3636
- name: "Run PHP_CodeSniffer"
3737
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"
38+
39+
rector:
40+
name: "Rector"
41+
runs-on: "ubuntu-22.04"
42+
43+
steps:
44+
- name: "Checkout"
45+
uses: "actions/checkout@v4"
46+
47+
- name: "Setup"
48+
uses: "./.github/actions/setup"
49+
with:
50+
php-version: ${{ env.PHP_VERSION }}
51+
driver-version: ${{ env.DRIVER_VERSION }}
52+
53+
- name: "Run Rector"
54+
run: "vendor/bin/rector --ansi --dry-run"

.github/workflows/release.yml

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ jobs:
9393
aws_region_name: ${{ vars.AWS_REGION_NAME }}
9494
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
9595

96-
# Create a draft release with release message filled in
9796
- name: "Prepare release message"
9897
run: |
9998
cat > release-message <<'EOL'
@@ -103,7 +102,6 @@ jobs:
103102
- name: "Create draft release"
104103
run: echo "RELEASE_URL=$(gh release create ${{ inputs.version }} --target ${{ github.ref_name }} --title "${{ inputs.version }}" --notes-file release-message --draft)" >> "$GITHUB_ENV"
105104

106-
# This step creates the signed release tag
107105
- name: "Create release tag"
108106
uses: mongodb-labs/drivers-github-tools/git-sign@v2
109107
with:
@@ -119,11 +117,89 @@ jobs:
119117
- name: "Push changes from release branch"
120118
run: git push
121119

122-
# Pushing the release tag starts build processes that then produce artifacts for the release
123120
- name: "Push release tag"
124121
run: git push origin ${{ inputs.version }}
125122

126123
- name: "Set summary"
127124
run: |
128125
echo '🚀 Created tag and drafted release for version [${{ inputs.version }}](${{ env.RELEASE_URL }})' >> $GITHUB_STEP_SUMMARY
129126
echo '✍️ You may now update the release notes and publish the release when ready' >> $GITHUB_STEP_SUMMARY
127+
128+
static-analysis:
129+
needs: prepare-release
130+
name: "Run Static Analysis"
131+
uses: ./.github/workflows/static-analysis.yml
132+
with:
133+
ref: refs/tags/${{ inputs.version }}
134+
permissions:
135+
security-events: write
136+
id-token: write
137+
138+
publish-ssdlc-assets:
139+
needs: static-analysis
140+
environment: release
141+
name: "Publish SSDLC Assets"
142+
runs-on: ubuntu-latest
143+
permissions:
144+
security-events: read
145+
id-token: write
146+
contents: write
147+
148+
steps:
149+
- name: "Create temporary app token"
150+
uses: actions/create-github-app-token@v1
151+
id: app-token
152+
with:
153+
app-id: ${{ vars.APP_ID }}
154+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
155+
156+
- name: "Store GitHub token in environment"
157+
run: echo "GH_TOKEN=${{ steps.app-token.outputs.token }}" >> "$GITHUB_ENV"
158+
shell: bash
159+
160+
- uses: actions/checkout@v4
161+
with:
162+
ref: refs/tags/${{ inputs.version }}
163+
token: ${{ env.GH_TOKEN }}
164+
165+
# Sets the S3_ASSETS environment variable used later
166+
- name: "Set up drivers-github-tools"
167+
uses: mongodb-labs/drivers-github-tools/setup@v2
168+
with:
169+
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
170+
aws_region_name: ${{ vars.AWS_REGION_NAME }}
171+
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
172+
173+
- name: "Generate authorized publication document"
174+
uses: mongodb-labs/drivers-github-tools/authorized-pub@v2
175+
with:
176+
product_name: "MongoDB PHP Driver (library)"
177+
release_version: ${{ inputs.version }}
178+
filenames: ""
179+
token: ${{ env.GH_TOKEN }}
180+
181+
- name: "Download SBOM file from Silk"
182+
uses: mongodb-labs/drivers-github-tools/sbom@v2
183+
with:
184+
silk_asset_group: mongodb-php-driver-library
185+
186+
- name: "Upload SBOM as release artifact"
187+
run: gh release upload ${{ inputs.version }} ${{ env.S3_ASSETS }}/cyclonedx.sbom.json
188+
continue-on-error: true
189+
190+
- name: "Generate SARIF report from code scanning alerts"
191+
uses: mongodb-labs/drivers-github-tools/code-scanning-export@v2
192+
with:
193+
ref: ${{ inputs.version }}
194+
output-file: ${{ env.S3_ASSETS }}/code-scanning-alerts.json
195+
196+
- name: "Generate compliance report"
197+
uses: mongodb-labs/drivers-github-tools/compliance-report@v2
198+
with:
199+
token: ${{ env.GH_TOKEN }}
200+
201+
- name: Upload S3 assets
202+
uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
203+
with:
204+
version: ${{ inputs.version }}
205+
product_name: mongo-php-library

.github/workflows/static-analysis.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ on:
1212
- "v*.*"
1313
- "master"
1414
- "feature/*"
15-
tags:
16-
- "*"
15+
workflow_call:
16+
inputs:
17+
ref:
18+
description: "The git ref to check"
19+
type: string
20+
required: true
1721

1822
env:
1923
PHP_VERSION: "8.2"
@@ -27,6 +31,8 @@ jobs:
2731
steps:
2832
- name: "Checkout"
2933
uses: "actions/checkout@v4"
34+
with:
35+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref }}
3036

3137
- name: "Setup"
3238
uses: "./.github/actions/setup"
@@ -41,20 +47,3 @@ jobs:
4147
uses: "github/codeql-action/upload-sarif@v3"
4248
with:
4349
sarif_file: psalm.sarif
44-
45-
rector:
46-
name: "Rector"
47-
runs-on: "ubuntu-22.04"
48-
49-
steps:
50-
- name: "Checkout"
51-
uses: "actions/checkout@v4"
52-
53-
- name: "Setup"
54-
uses: "./.github/actions/setup"
55-
with:
56-
php-version: ${{ env.PHP_VERSION }}
57-
driver-version: ${{ env.DRIVER_VERSION }}
58-
59-
- name: "Run Rector"
60-
run: "vendor/bin/rector --ansi --dry-run"

0 commit comments

Comments
 (0)