Skip to content

Version 0.4.31

Version 0.4.31 #34

Workflow file for this run

name: Publish on PyPI and Docker Hub
on:
push:
tags:
- v**
jobs:
check:
name: Verifying preconditions for releasing Evidently
runs-on: ubuntu-22.04
steps:
- name: Checking out sources
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Check _version.py was updated
env:
PYTHONPATH: ./src
run: |-
VERSION_TO_RELEASE=v$(python -c "from evidently import __version__; print(__version__)" || cat ../src/evidently/_version.py | grep "version_info = " | grep -Po "\d+" | tr '\n' . | cut -c 1-5)
if [ "${{ github.ref_name }}" != "$VERSION_TO_RELEASE" ]; then
echo "Release triggered for tag ${{ github.ref_name }} but version.py contains $VERSION_TO_RELEASE"
exit 1
fi
build:
name: Build distribution
runs-on: ubuntu-22.04
needs:
- check
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install dependencies
run: pip install -r requirements.min.txt
- name: Install wheel
run: pip install wheel
- name: Build a binary wheel and a source tarball
run: python setup.py sdist bdist_wheel
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish_to_pypi:
name: Publish Python distributions to PyPI and TestPyPI
runs-on: [ubuntu-22.04]
needs:
- build
permissions:
id-token: write
environment:
name: Release
url: https://pypi.org/p/evidently
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
build_and_publish_docker:
name: Build Docker image and publish it to DockerHub
runs-on: [ubuntu-22.04]
needs:
- build
environment:
name: Release
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v4
- id: login
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- id: generate-tag
name: Santize branch name the same way normalize function of argo-cd works
run: |
tag_name=${GITHUB_REF_NAME#v}
echo "generated-tag=$tag_name" >> "$GITHUB_OUTPUT"
- id: docker-push-tagged
name: Tag Docker image and push to DockerHub
uses: docker/build-push-action@v5
with:
file: docker/Dockerfile.service
platforms: linux/amd64,linux/arm64
push: true
tags: evidently/evidently-service:${{ steps.generate-tag.outputs.generated-tag }},evidently/evidently-service:latest
create_release:
name: Create release for the Tag
runs-on: [ubuntu-22.04]
needs:
- publish_to_pypi
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- id: create_release
name: Create Release for the Tag
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
generateReleaseNotes: true