From 820a7709b6e42517a633c259365dfae420d54835 Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Mon, 29 Jan 2024 16:25:50 -0500 Subject: [PATCH] remove unused environment url, use setup-python-hatch, publish artifacts dynamically --- .github/actions/setup-python-env/action.yml | 20 -------------------- .github/workflows/release.yml | 10 +++++++--- 2 files changed, 7 insertions(+), 23 deletions(-) delete mode 100644 .github/actions/setup-python-env/action.yml diff --git a/.github/actions/setup-python-env/action.yml b/.github/actions/setup-python-env/action.yml deleted file mode 100644 index 1ab687f6..00000000 --- a/.github/actions/setup-python-env/action.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Setup Python env -description: Install Python & Hatch -inputs: - python-version: - description: 'Version of Python to Install' - required: true - default: '3.9' -runs: - using: "composite" - steps: - - name: "Set up Python ${{ inputs.python-version }}" - uses: actions/setup-python@v4 - with: - python-version: "${{ inputs.python-version }}" - - - name: Install Hatch - shell: bash - run: | - python -m pip install --user --upgrade pip - python -m pip install hatch diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa8bdd91..1e32591e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,6 @@ jobs: runs-on: ubuntu-latest environment: name: ${{ inputs.deploy-to }} - url: ${{ vars.PYPI_URL }} permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing @@ -40,7 +39,7 @@ jobs: persist-credentials: false - name: "Set up Python & Hatch - 3.11" - uses: ./.github/actions/setup-python-env + uses: ./.github/actions/setup-python-hatch with: python-version: "3.11" @@ -52,7 +51,12 @@ jobs: run: hatch run build:check-all shell: bash - - name: Publish artifacts to PyPI + - name: Publish artifacts to PyPI Test + if: inputs.deploy-to == 'PypiTest' uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ + + - name: Publish artifacts to PyPI Prod + if: inputs.deploy-to == 'PypiProd' + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file