Skip to content

Commit d5b89d4

Browse files
committed
PYTHON-5047 Improve testing of publish workflows
1 parent 6343462 commit d5b89d4

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

.github/workflows/codeql.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on:
2626

2727
jobs:
2828
analyze:
29-
name: Analyze
29+
name: Analyze ${{ matrix.language }}
3030
runs-on: ubuntu-latest
3131
timeout-minutes: 360
3232
permissions:
@@ -36,6 +36,12 @@ jobs:
3636
packages: read
3737
actions: read
3838
contents: read
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
include:
43+
- language: python
44+
- language: actions
3945

4046
steps:
4147
- name: Checkout repository
@@ -52,7 +58,7 @@ jobs:
5258
- name: Initialize CodeQL
5359
uses: github/codeql-action/init@v3
5460
with:
55-
languages: python
61+
languages: ${{ matrix.language }}
5662
build-mode: none
5763
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
5864
queries: security-extended
@@ -62,10 +68,11 @@ jobs:
6268
- 'tests/**'
6369
6470
- shell: bash
71+
if: matrix.language == 'python'
6572
run: |
6673
pip install -e .
6774
6875
- name: Perform CodeQL Analysis
6976
uses: github/codeql-action/analyze@v3
7077
with:
71-
category: "/language:python"
78+
category: "/language:${{ matrix.language }}"

.github/workflows/release-python.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@ on:
1313
description: "Dry Run?"
1414
default: false
1515
type: boolean
16+
schedule:
17+
- cron: '30 5 * * *'
1618

1719
env:
1820
# Changes per repo
1921
PRODUCT_NAME: django-mongodb-backend
2022
# Changes per branch
2123
SILK_ASSET_GROUP: django-mongodb-backend-main
2224
EVERGREEN_PROJECT: django-mongodb-backend
25+
# Constant
26+
DRY_RUN: ${{ inputs.dry_run || 'true' }}
27+
FOLLOWING_VERSION: ${{ inputs.following_version || '' }}
28+
VERSION: ${{ inputs.version || '10.10.10.10' }}
2329

2430
defaults:
2531
run:
@@ -48,8 +54,8 @@ jobs:
4854
- uses: mongodb-labs/drivers-github-tools/python/pre-publish@v2
4955
id: pre-publish
5056
with:
51-
version: ${{ inputs.version }}
52-
dry_run: ${{ inputs.dry_run }}
57+
version: ${{ env.VERSION }}
58+
dry_run: ${{ env.DRY_RUN }}
5359

5460
build-dist:
5561
needs: [pre-publish]
@@ -82,7 +88,7 @@ jobs:
8288
repository-url: https://test.pypi.org/legacy/
8389
skip-existing: true
8490
- name: Publish package distributions to PyPI
85-
if: startsWith(inputs.dry_run, 'false')
91+
if: startsWith(env.DRY_RUN, 'false')
8692
uses: pypa/gh-action-pypi-publish@release/v1
8793

8894
post-publish:
@@ -107,10 +113,10 @@ jobs:
107113
artifactory_username: ${{ vars.ARTIFACTORY_USERNAME }}
108114
- uses: mongodb-labs/drivers-github-tools/python/post-publish@v2
109115
with:
110-
version: ${{ inputs.version }}
111-
following_version: ${{ inputs.following_version }}
116+
version: ${{ env.VERSION }}
117+
following_version: ${{ env.FOLLOWING_VERSION }}
112118
product_name: ${{ env.PRODUCT_NAME }}
113119
silk_asset_group: ${{ env.SILK_ASSET_GROUP }}
114120
evergreen_project: ${{ env.EVERGREEN_PROJECT }}
115121
token: ${{ github.token }}
116-
dry_run: ${{ inputs.dry_run }}
122+
dry_run: ${{ env.DRY_RUN }}

0 commit comments

Comments
 (0)