Skip to content

Commit

Permalink
check that dbt-athena is published before building dbt-athena-community
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Oct 11, 2024
1 parent 0021714 commit 7f60b75
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ on:
permissions:
contents: read

defaults:
run:
shell: bash

jobs:
publish:
runs-on: ubuntu-latest
environment:
name: ${{ inputs.deploy-to }}
url: ${{ vars.PYPI_PROJECT_URL }}${{ inputs.package }}
url: ${{ vars.PYPI_PROJECT_URL }}/${{ inputs.package }}
permissions:
# this permission is required for trusted publishing
# see https://github.com/marketplace/actions/pypi-publish
Expand All @@ -40,9 +44,27 @@ jobs:
# hatch will build using test PyPI first and fall back to prod PyPI when deploying to test
# this is done via environment variables in the test environment in GitHub
- run: hatch build && hatch run build:check-all
shell: bash
working-directory: ./${{ inputs.package }}
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: ${{ vars.PYPI_REPOSITORY_URL }}
packages-dir: ${{ inputs.package }}/dist/

verify:
runs-on: ubuntu-latest
needs: publish
# check the correct index
environment:
name: ${{ inputs.deploy-to }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- run: echo "UPLOADED_VERSION=$(hatch version)" >> $GITHUB_ENV
working-directory: ./${{ inputs.package }}
- uses: nick-fields/retry@v3
with:
timeout_seconds: 10
retry_wait_seconds: 10
max_attempts: 15 # 5 minutes: (10s timeout + 10s delay) * 15 attempts
command: wget ${{ vars.PYPI_PROJECT_URL }}/${{ inputs.package }}/$(UPLOADED_VERSION)/

0 comments on commit 7f60b75

Please sign in to comment.