Skip to content

Commit 848ab4f

Browse files
authored
PYTHON-5047 Improve testing of publish workflows (#2080)
1 parent 2225cca commit 848ab4f

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

.github/workflows/release-python.yml

Lines changed: 17 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: PyMongo
2022
# Changes per branch
2123
SILK_ASSET_GROUP: mongodb-python-driver
2224
EVERGREEN_PROJECT: mongo-python-driver
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]
@@ -78,8 +84,13 @@ jobs:
7884
with:
7985
name: all-dist-${{ github.run_id }}
8086
path: dist/
87+
- name: Publish package distributions to TestPyPI
88+
uses: pypa/gh-action-pypi-publish@release/v1
89+
with:
90+
repository-url: https://test.pypi.org/legacy/
91+
skip-existing: true
8192
- name: Publish package distributions to PyPI
82-
if: startsWith(inputs.dry_run, 'false')
93+
if: startsWith(env.DRY_RUN, 'false')
8394
uses: pypa/gh-action-pypi-publish@release/v1
8495

8596
post-publish:
@@ -104,10 +115,10 @@ jobs:
104115
artifactory_username: ${{ vars.ARTIFACTORY_USERNAME }}
105116
- uses: mongodb-labs/drivers-github-tools/python/post-publish@v2
106117
with:
107-
version: ${{ inputs.version }}
108-
following_version: ${{ inputs.following_version }}
118+
version: ${{ env.VERSION }}
119+
following_version: ${{ env.FOLLOWING_VERSION }}
109120
product_name: ${{ env.PRODUCT_NAME }}
110121
silk_asset_group: ${{ env.SILK_ASSET_GROUP }}
111122
evergreen_project: ${{ env.EVERGREEN_PROJECT }}
112123
token: ${{ github.token }}
113-
dry_run: ${{ inputs.dry_run }}
124+
dry_run: ${{ env.DRY_RUN }}

0 commit comments

Comments
 (0)