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
27 changes: 20 additions & 7 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,33 +19,49 @@ 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:
Comment thread
RomFloreani marked this conversation as resolved.
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
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: 'mira-simpeg'
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 }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Loading