Skip to content
Merged
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
25 changes: 19 additions & 6 deletions .github/workflows/python_deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
types: [published]
workflow_dispatch:
inputs:
release-tag:
description: 'Tag for the existing (draft) release to publish assets from'
required: true
publish-conda:
description: 'Publish Conda package'
required: false
Expand All @@ -22,32 +19,48 @@ on:
permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.event.release.tag_name || github.event.inputs.release-tag || github.run_id }}
group: ${{ github.workflow }}-${{ github.event.release.tag_name || github.ref_name }}
cancel-in-progress: true

jobs:
# Fail-fast guard, so it fails here rather than in the downstream jobs.
validate-release-tag:
name: Validate release tag
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Ensure this run was triggered from a tag
if: ${{ github.event_name == 'workflow_dispatch' && github.ref_type != 'tag' }}
env:
REF_TYPE: ${{ github.ref_type }}
REF_NAME: ${{ github.ref_name }}
run: |
echo "::error::This run was not triggered from a tag (ref_type=$REF_TYPE, ref_name=$REF_NAME). Re-run this workflow selecting the release tag under 'Use workflow from'."
exit 1
Comment on lines +27 to +39

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: still run the check if ref_type is 'tag' and return it passed

Currentyl, the step shows as skipped when using workflow_dispatch and selecting a tag. Somewhat confusing. Better to show that a tag was actually validated.
See here https://github.com/MiraGeoscience/simpeg-drivers/actions/runs/33392669744

Also have a check on the tag starting with v, as this is the requirement to consider it a release tag.

call-workflow-conda-release:
name: Publish production Conda package on JFrog Artifactory
needs: validate-release-tag
if: ${{ github.event_name == 'release' || github.event.inputs.publish-conda == 'true' }}
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_conda_assets.yml@v3
permissions:
contents: write
with:
virtual-repo-names: '["public-noremote-conda-prod"]'
release-tag: ${{ github.event.release.tag_name || github.event.inputs.release-tag }}
release-tag: ${{ github.event.release.tag_name || github.ref_name }}
secrets:
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
call-workflow-pypi-release:
name: Publish production PyPI package (JFrog Artifactory, PyPI)
needs: validate-release-tag
if: ${{ github.event_name == 'release' || github.event.inputs.publish-pypi == 'true' }}
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_pypi_assets.yml@v3
permissions:
contents: write
with:
package-name: 'simpeg-drivers'
virtual-repo-names: '["public-pypi-prod", "pypi"]'
release-tag: ${{ github.event.release.tag_name || github.event.inputs.release-tag }}
release-tag: ${{ github.event.release.tag_name || github.ref_name }}
secrets:
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
Expand Down
Loading