Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- language: actions
build-mode: none
steps:
- uses: mongodb-labs/drivers-github-tools/codeql@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
- uses: mongodb-labs/drivers-github-tools/codeql@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
language: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
Expand Down
76 changes: 69 additions & 7 deletions .github/workflows/create-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@ on:
push_changes:
description: Whether to push the changes
default: "true"
workflow_call:
inputs:
version:
description: >-
The released version. A branch is only created for a new
major/minor line (X.Y.0); patch releases reuse the existing branch.
required: true
type: string
base_ref:
description: The base reference for the branch (typically the release tag)
required: false
type: string
push_changes:
description: Whether to push the changes
required: false
type: string
default: "true"
secrets:
APP_PRIVATE_KEY:
required: true
AWS_ROLE_ARN:
required: true
AWS_SECRET_ID:
required: true

concurrency:
group: create-branch-${{ github.ref }}
Expand All @@ -24,14 +48,51 @@ defaults:
shell: bash -eux {0}

jobs:
release-branch:
runs-on: ubuntu-latest
permissions: {}
outputs:
create: ${{ steps.compute.outputs.create }}
branch_name: ${{ steps.compute.outputs.branch_name }}
branch_version: ${{ steps.compute.outputs.branch_version }}
steps:
- name: Compute the release branch name
id: compute
shell: bash -eu {0}
env:
VERSION: ${{ inputs.version }}
BRANCH_NAME: ${{ inputs.branch_name }}
run: |
# A release branch is only created for a new major/minor line (X.Y.0);
# an explicitly provided branch_name (manual dispatch) always wins.
# Dry runs pass a ref rather than a version, so they never create branches.
# The branch is set to the next patch dev version (4.17.0 -> 4.17.1.dev0).
if [ -n "$BRANCH_NAME" ]; then
branch_name="$BRANCH_NAME"
branch_version="$VERSION"
elif [[ "$VERSION" =~ ^([0-9]+)\.([0-9]+)\.0$ ]]; then
branch_name="v${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
branch_version="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.1.dev0"
else
branch_name=""
branch_version=""
fi
if [ -n "$branch_name" ]; then
echo "create=true" >> "$GITHUB_OUTPUT"
else
echo "create=false" >> "$GITHUB_OUTPUT"
fi
echo "branch_name=$branch_name" >> "$GITHUB_OUTPUT"
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
echo "branch_version=$branch_version" >> "$GITHUB_OUTPUT"

create-branch:
needs: release-branch
if: needs.release-branch.outputs.create == 'true'
environment: release
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
outputs:
version: ${{ steps.pre-publish.outputs.version }}
steps:
- name: Create app token
id: app-token
Expand All @@ -50,26 +111,27 @@ jobs:
with:
ref: ${{ github.ref }}
token: ${{ env.GH_TOKEN }}
fetch-depth: 1
# Full history and tags so base_ref (the release tag) can be resolved.
fetch-depth: 0
persist-credentials: false
- name: Configure git auth for push
shell: bash -eu {0}
run: |
auth_header=$(printf 'x-access-token:%s' "${GH_TOKEN}" | base64 -w0)
git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic ${auth_header}"
- uses: mongodb-labs/drivers-github-tools/setup@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
- uses: mongodb-labs/drivers-github-tools/setup@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
aws_region_name: ${{ vars.AWS_REGION_NAME }}
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
artifactory_username: ${{ vars.ARTIFACTORY_USERNAME }}
- name: Get hatch
run: pip install hatch
- uses: mongodb-labs/drivers-github-tools/create-branch@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
- uses: mongodb-labs/drivers-github-tools/create-branch@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
id: create-branch
with:
branch_name: ${{ inputs.branch_name }}
version: ${{ inputs.version }}
branch_name: ${{ needs.release-branch.outputs.branch_name }}
version: ${{ needs.release-branch.outputs.branch_version }}
base_ref: ${{ inputs.base_ref }}
push_changes: ${{ inputs.push_changes }}
version_bump_script: hatch version
Expand Down
29 changes: 23 additions & 6 deletions .github/workflows/release-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ jobs:
outputs:
version: ${{ steps.pre-publish.outputs.version }}
steps:
- uses: mongodb-labs/drivers-github-tools/secure-checkout@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
- uses: mongodb-labs/drivers-github-tools/secure-checkout@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
app_id: ${{ vars.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: mongodb-labs/drivers-github-tools/setup@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
- uses: mongodb-labs/drivers-github-tools/setup@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
aws_region_name: ${{ vars.AWS_REGION_NAME }}
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
- uses: mongodb-labs/drivers-github-tools/python/pre-publish@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
- uses: mongodb-labs/drivers-github-tools/python/pre-publish@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
id: pre-publish
with:
dry_run: ${{ env.DRY_RUN }}
Expand Down Expand Up @@ -93,19 +93,36 @@ jobs:
attestations: write
security-events: write
steps:
- uses: mongodb-labs/drivers-github-tools/secure-checkout@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
- uses: mongodb-labs/drivers-github-tools/secure-checkout@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
app_id: ${{ vars.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: mongodb-labs/drivers-github-tools/setup@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
- uses: mongodb-labs/drivers-github-tools/setup@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
aws_region_name: ${{ vars.AWS_REGION_NAME }}
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
- uses: mongodb-labs/drivers-github-tools/python/post-publish@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
- uses: mongodb-labs/drivers-github-tools/python/post-publish@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
following_version: ${{ env.FOLLOWING_VERSION }}
product_name: ${{ env.PRODUCT_NAME }}
evergreen_project: ${{ env.EVERGREEN_PROJECT }}
token: ${{ github.token }}
dry_run: ${{ env.DRY_RUN }}

create-release-branch:
# Runs only after the whole release succeeds. Creates a vX.Y branch for a
# new major/minor line (X.Y.0) and no-ops for patch releases; dry runs pass
# a ref instead of a version, so they never create a branch.
needs: [pre-publish, post-publish]
uses: $/.github/workflows/create-release-branch.yml
permissions:
id-token: write
contents: write
secrets:
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
AWS_SECRET_ID: ${{ secrets.AWS_SECRET_ID }}
with:
version: ${{ needs.pre-publish.outputs.version }}
Comment thread
sleepyStick marked this conversation as resolved.
Resolved
base_ref: ${{ needs.pre-publish.outputs.version }}
2 changes: 1 addition & 1 deletion .github/workflows/test-mod-wsgi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
with:
index: 1
- name: Install Python tooling
uses: mongodb-labs/drivers-github-tools/python/setup@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
uses: mongodb-labs/drivers-github-tools/python/setup@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
python-version: ${{ steps.versions.outputs.python-version }}
- name: Install Apache
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
persist-credentials: false
- name: Install Python tooling
uses: mongodb-labs/drivers-github-tools/python/setup@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
uses: mongodb-labs/drivers-github-tools/python/setup@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
python-version: "3.11"
# Runs before the install so a stale lock fails in seconds rather than
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
with:
persist-credentials: false
- name: Install Python tooling
uses: mongodb-labs/drivers-github-tools/python/setup@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
uses: mongodb-labs/drivers-github-tools/python/setup@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
# The beta Python here relies on the action's prerelease default.
python-version: ${{ matrix.python-version }}
Expand All @@ -103,7 +103,7 @@ jobs:
persist-credentials: false
submodules: true
- name: Install Python tooling
uses: mongodb-labs/drivers-github-tools/python/setup@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
uses: mongodb-labs/drivers-github-tools/python/setup@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
python-version: "3.11"
- id: setup-mongodb
Expand All @@ -129,7 +129,7 @@ jobs:
persist-credentials: false
submodules: true
- name: Install Python tooling
uses: mongodb-labs/drivers-github-tools/python/setup@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
uses: mongodb-labs/drivers-github-tools/python/setup@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
python-version: "3.11"
- name: Install dependencies
Expand All @@ -151,7 +151,7 @@ jobs:
with:
persist-credentials: false
- name: Install Python tooling
uses: mongodb-labs/drivers-github-tools/python/setup@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
uses: mongodb-labs/drivers-github-tools/python/setup@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
python-version: "3.11"
- name: Install dependencies
Expand All @@ -170,7 +170,7 @@ jobs:
with:
persist-credentials: false
- name: Install Python tooling
uses: mongodb-labs/drivers-github-tools/python/setup@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
uses: mongodb-labs/drivers-github-tools/python/setup@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
python-version: "${{matrix.python}}"
- name: Install dependencies
Expand All @@ -188,7 +188,7 @@ jobs:
persist-credentials: false
submodules: true
- name: Install Python tooling
uses: mongodb-labs/drivers-github-tools/python/setup@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
uses: mongodb-labs/drivers-github-tools/python/setup@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
python-version: "3.11"
- name: Install dependencies
Expand Down Expand Up @@ -274,7 +274,7 @@ jobs:
with:
persist-credentials: false
- name: Install Python tooling
uses: mongodb-labs/drivers-github-tools/python/setup@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1
uses: mongodb-labs/drivers-github-tools/python/setup@034ec34103f5a8080e19e09af25f0f6b7597bf8a # v3.2.0
with:
python-version: "3.11"
- id: setup-mongodb
Expand Down
Loading