Skip to content

Commit a5ad81f

Browse files
authored
Merge pull request #117 from zilliztech/pypi-release-workflow
Add PyPI release workflow
2 parents 3dfb207 + e0888aa commit a5ad81f

3 files changed

Lines changed: 46 additions & 1 deletion

File tree

.github/workflows/pypi_release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
pypi-publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Setup Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: "3.8"
17+
architecture: "x64"
18+
19+
- name: Install build tools
20+
run: |
21+
python3 -m pip install --upgrade pip
22+
python3 -m pip install --upgrade build
23+
python3 -m pip install --upgrade twine
24+
25+
- name: Build distribution packages
26+
run: python3 -m build
27+
28+
- name: Verify distribution packages
29+
run: |
30+
ls -lh dist/
31+
python3 -m twine check dist/*
32+
33+
- name: Log version information
34+
run: |
35+
CURRENT_VERSION=$(python3 -c "import re; content=open('setup.py').read(); print(re.search(r'version=\"(.+?)\"', content).group(1))")
36+
echo "Package version: $CURRENT_VERSION"
37+
echo "Release tag: ${GITHUB_REF#refs/tags/}"
38+
39+
- name: Upload to PyPI
40+
env:
41+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
42+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
43+
run: |
44+
python3 -m twine upload dist/*

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,4 @@ dmypy.json
135135

136136
# Test reports
137137
TEST_REPORT_*.md
138+
docs/plans/*

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="milvus_cli",
8-
version="v1.1.0",
8+
version="v1.2.0",
99
author="Milvus Team",
1010
author_email="milvus-team@zilliz.com",
1111
url="https://github.com/zilliztech/milvus_cli",

0 commit comments

Comments
 (0)