-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (39 loc) · 1.06 KB
/
py.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
name: Python package
# necessary check for Python project, publish to PyPI performed locally
on:
push:
branches:
- main
tags:
- v*
pull_request:
workflow_dispatch:
jobs:
py-package:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
pip install --no-cache-dir poetry
- name: verify
if: startsWith(github.ref, 'refs/tags/v')
run: |
py_version=$(poetry version --short)
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
tag_version=${VERSION#v}
if [[ $py_version != $tag_version ]] ; then
echo "publish version does not match, $py_version vs $tag_version"
exit 1
fi
- name: build
run: |
poetry install
poetry build
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
files: |
./openmldb_mixin/openmldb_dashboard.json