forked from lf-edge/ekuiper
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (65 loc) · 2.69 KB
/
upload_sdk.yaml
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
name: Upload sdk
on:
push:
tags:
- "*"
release:
types:
- published
jobs:
python:
runs-on: ubuntu-latest
if: github.repository == 'lf-edge/ekuiper'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: 'x64'
- run: python3 -m pip install --user --upgrade setuptools wheel twine
- name: Upload test pypi
env:
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
working-directory: "sdk/python"
run: |
version=$(grep -E ".+version.+" setup.py | sed -r 's [ \t]*version=(.*), \1 g' | sed $'s/\'//g')
test_version="${version}-${GITHUB_RUN_ID}"
sed -i -r "s|([ \t]*version=).*|\1'$test_version',|1" setup.py
python3 setup.py sdist bdist_wheel
python3 -m twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*
git checkout -- setup.py
- name: Install test pypi
working-directory: "sdk/python"
timeout-minutes: 1
run: |
version=$(grep -E ".+version.+" setup.py | sed -r 's [ \t]*version=(.*), \1 g' | sed $'s/\'//g')
while ! python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps ekuiper=="${version}.post${GITHUB_RUN_ID}" > /dev/null 2>&1; do
echo "================================================================="
echo "Awaiting pypi updates"
echo "================================================================="
sleep 1
done
python3 -m pip uninstall -y ekuiper
- name: Upload test pypi
if: github.event_name == 'release' && !github.event.release.prerelease
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
working-directory: "sdk/python"
run: |
sed -i -r "s|([ \t]*version=).*|\1'${GITHUB_REF#refs/tags/}',|1" setup.py
python3 setup.py sdist bdist_wheel
python3 -m twine upload --skip-existing dist/*
- name: Install pypi
if: github.event_name == 'release' && !github.event.release.prerelease
working-directory: "sdk/python"
timeout-minutes: 5
run: |
while ! python3 -m pip install --no-deps ekuiper > /dev/null 2>&1; do
echo "================================================================="
echo "Awaiting pypi updates"
echo "================================================================="
sleep 1
done
python3 -m pip uninstall -y ekuiper