Skip to content

v8.2.2

v8.2.2 #107

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Publish Pyatlan Package
on:
release:
types: [ published ]
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
deploy:
if: "success() && startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: uv sync --group dev
- name: check tag
id: check-tag
run: uv run python check_tag.py
- name: Build and publish to PyPI
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
uv build
uv publish
- name: Build Lambda layer
run: |
uv pip install --target=python .
- uses: actions/upload-artifact@v4
with:
name: lambda-layer
path: ./python
publish-images:
runs-on: ubuntu-latest
needs: deploy
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Log in to container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set image tag from file
id: set-image-tag
run: |
TAG=$(cat pyatlan/version.txt)
echo "IMAGE_TAG=$TAG" >> $GITHUB_ENV
- name: Wait for PyPI propagation
uses: nick-fields/retry@v3
with:
max_attempts: 10
timeout_minutes: 5
command: |
echo "Checking if pyatlan==${{ env.IMAGE_TAG }} is available on PyPI..."
if pip index versions pyatlan | grep -q "${{ env.IMAGE_TAG }}"; then
echo "Package is available on PyPI!"
exit 0
else
echo "Package not available yet. Retrying..."
exit 1
fi
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/atlanhq/atlan-python:${{ env.IMAGE_TAG }}
ghcr.io/atlanhq/atlan-python:latest
context: .
file: ./Dockerfile
build-args: VERSION=${{ env.IMAGE_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max