Skip to content

build artifact and publish to PyPi #58

build artifact and publish to PyPi

build artifact and publish to PyPi #58

name: build artifact and publish to PyPi
on:
workflow_dispatch:
inputs:
deploy_to_test:
type: boolean
description: 'Deploy to PyPi test'
required: false
default: false
workflow_run:
workflows: ["bump version"]
types:
- completed
jobs:
build_artifacts:
uses: ./.github/workflows/deploy_build_artifact.yaml
deploy_to_pypi_test:
needs: [build_artifacts]
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_to_test == 'true' }}
uses: ./.github/workflows/deploy_to_pypi.yml
with:
package-version: ${{ needs.build_artifacts.outputs.package-version }}
target-environment: 'pypi-test'
artifact-name: ${{ needs.build_artifacts.outputs.artifact-name }}
deploy_to_pypi_prod_after_test:
needs: [build_artifacts, deploy_to_pypi_test]
if: ${{ github.event.inputs.deploy_to_test == 'true' }}
uses: ./.github/workflows/deploy_to_pypi.yml
with:
package-version: ${{ needs.build_artifacts.outputs.package-version }}
target-environment: 'pypi-prod'
artifact-name: ${{ needs.build_artifacts.outputs.artifact-name }}
deploy_to_pypi_prod_direct:
needs: [build_artifacts]
if: ${{ github.event.inputs.deploy_to_test != 'true' }}
uses: ./.github/workflows/deploy_to_pypi.yml
with:
package-version: ${{ needs.build_artifacts.outputs.package-version }}
target-environment: 'pypi-prod'
artifact-name: ${{ needs.build_artifacts.outputs.artifact-name }}