Skip to content

Commit 35ddb05

Browse files
committed
Update release for v1.21
1 parent 9c53133 commit 35ddb05

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
type: "string"
1515

1616
env:
17+
PHP_VERSION: "8.2"
18+
DRIVER_VERSION: "mongodb/mongo-php-driver@${{ inputs.version }}"
19+
SBOM_FILE: "sbom.json"
1720
default-release-message: |
1821
The PHP team is happy to announce that version {0} of the MongoDB PHP library is now available.
1922
@@ -48,16 +51,12 @@ jobs:
4851
- name: "Create release output"
4952
run: echo '🎬 Release process for version ${{ inputs.version }} started by @${{ github.triggering_actor }}' >> $GITHUB_STEP_SUMMARY
5053

51-
- name: "Generate token and checkout repository"
52-
uses: mongodb-labs/drivers-github-tools/secure-checkout@v2
53-
with:
54-
app_id: ${{ vars.APP_ID }}
55-
private_key: ${{ secrets.APP_PRIVATE_KEY }}
56-
5754
- name: "Store version numbers in env variables"
5855
run: |
5956
echo RELEASE_VERSION=${{ inputs.version }} >> $GITHUB_ENV
57+
echo RELEASE_VERSION_WITHOUT_STABILITY=$(echo ${{ inputs.version }} | awk -F- '{print $1}') >> $GITHUB_ENV
6058
echo RELEASE_BRANCH=v$(echo ${{ inputs.version }} | cut -d '.' -f-2) >> $GITHUB_ENV
59+
echo DEV_BRANCH=v$(echo ${{ inputs.version }} | cut -d '.' -f-1).x >> $GITHUB_ENV
6160
6261
- name: "Ensure release tag does not already exist"
6362
run: |
@@ -66,8 +65,10 @@ jobs:
6665
exit 1
6766
fi
6867
69-
- name: "Fail if branch names don't match"
70-
if: ${{ github.ref_name != env.RELEASE_BRANCH }}
68+
# For patch releases (A.B.C where C != 0), we expect the release to be
69+
# triggered from the A.B maintenance branch
70+
- name: "Fail if patch release is created from wrong release branch"
71+
if: ${{ !endsWith(env.RELEASE_VERSION_WITHOUT_STABILITY, '.0') && env.RELEASE_BRANCH != github.ref_name }}
7172
run: |
7273
echo '❌ Release failed due to branch mismatch: expected ${{ inputs.version }} to be released from ${{ env.RELEASE_BRANCH }}, got ${{ github.ref_name }}' >> $GITHUB_STEP_SUMMARY
7374
exit 1
@@ -177,7 +178,7 @@ jobs:
177178
#
178179

179180
- name: "Set up drivers-github-tools"
180-
uses: mongodb-labs/drivers-github-tools/setup@v2
181+
uses: mongodb-labs/drivers-github-tools/setup@v3
181182
with:
182183
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
183184
aws_region_name: ${{ vars.AWS_REGION_NAME }}
@@ -190,10 +191,10 @@ jobs:
190191
EOL
191192
192193
- name: "Create draft release"
193-
run: echo "RELEASE_URL=$(gh release create ${{ inputs.version }} --target ${{ github.ref_name }} --title "${{ inputs.version }}" --notes-file release-message --draft)" >> "$GITHUB_ENV"
194+
run: echo "RELEASE_URL=$(gh release create ${{ inputs.version }} --target ${{ env.RELEASE_BRANCH }} --title "${{ inputs.version }}" --notes-file release-message --draft)" >> "$GITHUB_ENV"
194195

195196
- name: "Create release tag"
196-
uses: mongodb-labs/drivers-github-tools/tag-version@v2
197+
uses: mongodb-labs/drivers-github-tools/tag-version@v3
197198
with:
198199
version: ${{ inputs.version }}
199200
tag_message_template: 'Release ${VERSION}'
@@ -232,22 +233,22 @@ jobs:
232233

233234
steps:
234235
- name: "Generate token and checkout repository"
235-
uses: mongodb-labs/drivers-github-tools/secure-checkout@v2
236+
uses: mongodb-labs/drivers-github-tools/secure-checkout@v3
236237
with:
237238
app_id: ${{ vars.APP_ID }}
238239
private_key: ${{ secrets.APP_PRIVATE_KEY }}
239240
ref: refs/tags/${{ inputs.version }}
240241

241242
# Sets the S3_ASSETS environment variable used later
242243
- name: "Set up drivers-github-tools"
243-
uses: mongodb-labs/drivers-github-tools/setup@v2
244+
uses: mongodb-labs/drivers-github-tools/setup@v3
244245
with:
245246
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
246247
aws_region_name: ${{ vars.AWS_REGION_NAME }}
247248
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
248249

249250
- name: "Generate SSDLC Reports"
250-
uses: mongodb-labs/drivers-github-tools/full-report@v2
251+
uses: mongodb-labs/drivers-github-tools/full-report@v3
251252
with:
252253
product_name: "MongoDB PHP Driver (library)"
253254
release_version: ${{ inputs.version }}
@@ -258,7 +259,7 @@ jobs:
258259
continue-on-error: true
259260

260261
- name: Upload S3 assets
261-
uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
262+
uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v3
262263
with:
263264
version: ${{ inputs.version }}
264-
product_name: mongo-php-library
265+
product_name: mongo-php-library

0 commit comments

Comments
 (0)