Skip to content
24 changes: 18 additions & 6 deletions .github/workflows/release-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@
description: "Dry Run?"
default: false
type: boolean
schedule:
- cron: '30 5 * * *'

env:
# Changes per repo
PRODUCT_NAME: PyMongoCrypt
# Changes per branch
SILK_ASSET_GROUP: pymongocrypt
EVERGREEN_PROJECT: libmongocrypt
# Constant
DRY_RUN: ${{ inputs.dry_run == 'true' }}
FOLLOWING_VERSION: ${{ inputs.following_version || '' }}
VERSION: ${{ inputs.version || '10.10.10.10' }}

defaults:
run:
Expand Down Expand Up @@ -48,9 +54,9 @@
- uses: mongodb-labs/drivers-github-tools/python/pre-publish@v2
id: pre-publish
with:
version: ${{ inputs.version }}
version: ${{ env.VERSION }}
working_directory: ./bindings/python
dry_run: ${{ inputs.dry_run }}
dry_run: ${{ env.DRY_RUN }}
tag_template: "pymongocrypt-${VERSION}"
tag_message_template: "Release PyMongoCrypt ${VERSION}"

Expand Down Expand Up @@ -80,8 +86,14 @@
with:
name: all-dist-${{ github.run_id }}
path: dist/
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
attestations: ${{ env.DRY_RUN }}
- name: Publish package distributions to PyPI
if: startsWith(inputs.dry_run, 'false')
if: startsWith(env.DRY_RUN, 'false')
uses: pypa/gh-action-pypi-publish@release/v1

post-publish:
Expand All @@ -106,12 +118,12 @@
artifactory_username: ${{ vars.ARTIFACTORY_USERNAME }}
- uses: mongodb-labs/drivers-github-tools/python/post-publish@v2
with:
version: ${{ inputs.version }}
following_version: ${{ inputs.following_version }}
version: ${{ env.VERSION }}
following_version: ${{ env.FOLLOWING_VERSION }}
working_directory: ./bindings/python
product_name: ${{ env.PRODUCT_NAME }}
silk_asset_group: ${{ env.SILK_ASSET_GROUP }}
evergreen_project: ${{ env.EVERGREEN_PROJECT }}
tag_template: "pymongocrypt-${VERSION}"
token: ${{ github.token }}
dry_run: ${{ inputs.dry_run }}
dry_run: ${{ env.DRY_RUN }}
Loading