From 1cd0d66c9f8530178b3c8afdff5ad0fb9bb1db36 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Fri, 26 Jan 2024 13:17:26 -0500 Subject: [PATCH] reuse shared actions from `dbt-adapters` --- .github/actions/publish-pypi/action.yml | 25 -------------------- .github/actions/setup-environment/action.yml | 18 -------------- .github/workflows/release.yml | 9 ++++--- 3 files changed, 6 insertions(+), 46 deletions(-) delete mode 100644 .github/actions/publish-pypi/action.yml delete mode 100644 .github/actions/setup-environment/action.yml diff --git a/.github/actions/publish-pypi/action.yml b/.github/actions/publish-pypi/action.yml deleted file mode 100644 index 01cbc1cb..00000000 --- a/.github/actions/publish-pypi/action.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Publish PyPI - -inputs: - python-version: - description: Create an environment with the appropriate version of python and hatch installed - default: "3.11" - -runs: - using: composite - steps: - - name: Setup environment - uses: ./.github/actions/setup-environment - with: - python-version: ${{ inputs.python-version }} - - - name: Build artifacts - run: hatch build - shell: bash - - - name: Check artifacts - run: hatch run build:check-all - shell: bash - - - name: Publish artifacts to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/actions/setup-environment/action.yml b/.github/actions/setup-environment/action.yml deleted file mode 100644 index 6227c698..00000000 --- a/.github/actions/setup-environment/action.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Setup `hatch` - -inputs: - python-version: - description: Create an environment with the appropriate version of python and hatch installed - required: true - -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 - run: python -m pip install hatch - shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b92ee91..e4d31bf6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest environment: name: ${{ inputs.deploy-to }} - url: ${{ vars.PYPI_URL }} + url: ${{ vars.PYPI_PROJECT_URL }} permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing @@ -39,7 +39,10 @@ jobs: with: persist-credentials: false + - name: Setup environment + uses: dbt-labs/dbt-adapters/.github/actions/setup-environment + - name: Publish to PyPI - uses: ./.github/actions/publish-pypi + uses: dbt-labs/dbt-adapters/.github/actions/publish-pypi.yml@main with: - python-version: "3.11" + deploy-to: ${{ inputs.deploy-to }}