-
Notifications
You must be signed in to change notification settings - Fork 805
179 lines (156 loc) · 4.78 KB
/
release.yml
File metadata and controls
179 lines (156 loc) · 4.78 KB
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
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.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- 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.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Build a binary wheel and a source tarball
run: uv build
- 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
generate-api-reference:
name: Generate API reference documentation from PyPI version
runs-on: ubuntu-22.04
continue-on-error: true
needs:
- publish_to_pypi
steps:
- uses: actions/checkout@v4
- name: 📚 Generate and upload API reference
uses: ./.github/share-actions/generate-api-reference
with:
flags: --git-revision ${{ github.ref_name }}
- name: Upload documentation artifact
uses: actions/upload-artifact@v4
with:
name: api-reference
path: api-reference/dist
retention-days: 5
download-and-deploy-api-reference:
name: Download and deploy API reference documentation
runs-on: ubuntu-22.04
continue-on-error: true
needs:
- generate-api-reference
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
fetch-depth: 0
- name: 📥 Download API reference artifact
uses: actions/download-artifact@v4
with:
name: api-reference
path: ./artifacts/api-reference
# this action exists in `gh-pages` branch
- name: 📚 Download and deploy API reference documentation
uses: ./.github/share-actions/build-and-deploy
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