-
Notifications
You must be signed in to change notification settings - Fork 613
135 lines (119 loc) · 3.62 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
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 "./src/evidently/_version.py")
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