diff --git a/.github/workflows/python_deploy_dev.yml b/.github/workflows/python_deploy_dev.yml index 34d0b38e22..ab1ae5843e 100644 --- a/.github/workflows/python_deploy_dev.yml +++ b/.github/workflows/python_deploy_dev.yml @@ -5,6 +5,10 @@ on: tags: - 'v*' # Push events to every version tag (eg. v1.0.0) +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true + jobs: call-workflow-conda-publish: name: Publish development conda package on JFrog Artifactory @@ -12,7 +16,7 @@ jobs: with: package-name: 'mira-simpeg' python-version: '3.10' - virtual-repo-nameS: '["public-conda-dev"]' + virtual-repo-names: '["public-conda-dev"]' secrets: JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} diff --git a/.github/workflows/python_deploy_prod.yml b/.github/workflows/python_deploy_prod.yml index 47d9b9b3cd..b5d2853e52 100644 --- a/.github/workflows/python_deploy_prod.yml +++ b/.github/workflows/python_deploy_prod.yml @@ -3,27 +3,43 @@ name: Deploy python package in production on: release: 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 + default: true + publish-pypi: + description: 'Publish PyPI package' + required: false + default: true + +concurrency: + group: ${{ github.workflow }}-${{ github.event.release.tag_name || github.event.inputs.release-tag || github.run_id }} + cancel-in-progress: true jobs: - call-workflow-conda-publish: - name: Publish production conda package on JFrog Artifactory - uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_conda_package.yml@main + call-workflow-conda-release: + name: Publish production Conda package on JFrog Artifactory + uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_conda_assets.yml@main + if: ${{ github.event_name == 'release' || github.event.inputs.publish-conda == 'true' }} with: - package-name: 'mira-simpeg' - python-version: '3.10' virtual-repo-names: '["public-conda-prod"]' + release-tag: ${{ github.event.release.tag_name || github.event.inputs.release-tag }} secrets: JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} - call-workflow-pypi-publish: - name: Publish production pypi package (JFrog Artifactory and PyPI) - uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_pypi_package.yml@main + call-workflow-pypi-release: + name: Publish production PyPI package (JFrog Artifactory and PyPI) + if: ${{ github.event_name == 'release' || github.event.inputs.publish-pypi == 'true' }} + uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_pypi_assets.yml@main with: - package-manager: 'setuptools' package-name: 'mira-simpeg' - version-tag: ${{ github.ref_name }} - python-version: '3.10' virtual-repo-names: '["public-pypi-prod", "pypi"]' + release-tag: ${{ github.event.release.tag_name || github.event.inputs.release-tag }} secrets: JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9e0f4bc35f..f8427df743 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,8 @@ default_language_version: python: python3 +default_stages: [pre-commit,pre-push] +fail_fast: false + repos: - repo: https://github.com/psf/black-pre-commit-mirror rev: 24.3.0