From 0798899c6b731d4428a908eee7542c0da49ed64f Mon Sep 17 00:00:00 2001 From: rob al Date: Tue, 23 Jul 2024 17:18:31 +0000 Subject: [PATCH 1/3] tidy scripts --- .github/workflows/deploy_to_pypi.yml | 4 ++-- .github/workflows/deploy_workflow_wrapper.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_to_pypi.yml b/.github/workflows/deploy_to_pypi.yml index f3645cb..cc83d30 100644 --- a/.github/workflows/deploy_to_pypi.yml +++ b/.github/workflows/deploy_to_pypi.yml @@ -1,4 +1,4 @@ -name: Publish the completed package to Pypi +name: Publish the completed package to PyPi on: workflow_call: @@ -45,7 +45,7 @@ jobs: # version=$(grep 'version =' pyproject.toml | awk '{print $3}' | sed 's/"//g') # echo "VERSION=$version" >> $GITHUB_ENV # echo "extracted version '{{ $env.VERSION }}' from pyproject.toml" - - name: Publish package distributions to TestPyPI + - name: Publish package distributions to ${{ inputs.target-environment }} uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: ${{ vars.PYPI_URL }} diff --git a/.github/workflows/deploy_workflow_wrapper.yml b/.github/workflows/deploy_workflow_wrapper.yml index ce651a3..b9d23e8 100644 --- a/.github/workflows/deploy_workflow_wrapper.yml +++ b/.github/workflows/deploy_workflow_wrapper.yml @@ -1,4 +1,4 @@ -name: build artifact and publish to pypi test +name: build artifact and publish to pypi on: # whenever a PR is closed against main, or allow manual runs workflow_dispatch: From 678341b80f227c621a3e2a210e615f0a43bc15d7 Mon Sep 17 00:00:00 2001 From: rob al Date: Wed, 24 Jul 2024 02:33:46 +0000 Subject: [PATCH 2/3] chore: Add option to deploy to PyPi test in deploy workflow --- .github/workflows/deploy_workflow_wrapper.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_workflow_wrapper.yml b/.github/workflows/deploy_workflow_wrapper.yml index b9d23e8..10349e9 100644 --- a/.github/workflows/deploy_workflow_wrapper.yml +++ b/.github/workflows/deploy_workflow_wrapper.yml @@ -2,6 +2,12 @@ name: build artifact and publish to pypi on: # whenever a PR is closed against main, or allow manual runs workflow_dispatch: + inputs: + deploy_to_test: + type: boolean + description: 'Deploy to PyPi test' + required: false + default: false workflow_run: workflows: ["bump version"] types: @@ -16,9 +22,9 @@ jobs: # package-version: # artifact-name: - # test this here, then move to deploy_to_pypi.yml deploy_to_pypi_test: 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 }} From a7565db269eb196257ac6f16133293d54ca50ef6 Mon Sep 17 00:00:00 2001 From: rob al Date: Wed, 24 Jul 2024 02:35:36 +0000 Subject: [PATCH 3/3] chore: Update deploy workflow to use PyPi instead of pypi --- .github/workflows/deploy_workflow_wrapper.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_workflow_wrapper.yml b/.github/workflows/deploy_workflow_wrapper.yml index 10349e9..94a2769 100644 --- a/.github/workflows/deploy_workflow_wrapper.yml +++ b/.github/workflows/deploy_workflow_wrapper.yml @@ -1,6 +1,6 @@ -name: build artifact and publish to pypi +name: build artifact and publish to PyPi on: - # whenever a PR is closed against main, or allow manual runs + # whenever version is bumped, or allow manual runs workflow_dispatch: inputs: deploy_to_test: @@ -30,7 +30,7 @@ jobs: package-version: ${{ needs.build_artifacts.outputs.package-version }} target-environment: 'pypi-test' artifact-name: ${{ needs.build_artifacts.outputs.artifact-name }} - + deploy_to_pypi_prod: needs: [build_artifacts] uses: ./.github/workflows/deploy_to_pypi.yml