Version 0.4.17 #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish on PyPI and Docker Hub | |
on: | |
push: | |
tags: | |
- v** | |
jobs: | |
check: | |
name: Verifying preconditions for releasing Evidently | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out sources | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
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-latest | |
needs: | |
- check | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
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-latest ] | |
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-latest ] | |
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-latest ] | |
needs: | |
- publish_to_pypi | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 | |