-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Poetry Setup | ||
uses: abatilo/[email protected] | ||
- name: Publish to PyPI | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
poetry config pypi-token.pypi $PYPI_TOKEN | ||
poetry publish --build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,27 @@ on: | |
- "v*" | ||
|
||
jobs: | ||
pypi: | ||
name: Publish to PyPI | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Poetry Setup | ||
uses: abatilo/[email protected] | ||
- name: Publish to PyPI | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
poetry publish --build -n --username __token__ --password "$PYPI_TOKEN" | ||
release: | ||
name: GitHub Release | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build tools | ||
run: | | ||
|
@@ -21,6 +37,31 @@ jobs: | |
run: | | ||
sudo apt-get install -y python3 python3-pip python-is-python3 | ||
- name: Poetry Setup | ||
uses: abatilo/[email protected] | ||
|
||
# Poetry cache with default ~.cache/pypoetry directory. | ||
# Update it when `poetry.lock` file changed. | ||
- name: Cache Poetry | ||
id: cache-poetry | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.cache/pypoetry | ||
key: ubuntu-20.04-poetry-${{ hashFiles('**/poetry.lock') }} | ||
|
||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
|
@@ -47,50 +88,12 @@ jobs: | |
./TDengine/build/build/bin/taosadapter & | ||
./TDengine/build/build/bin/taosd -c /tmp/taos/ & | ||
- name: Cache Poetry | ||
id: cache-poetry | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.poetry | ||
key: ubuntu-20.04-poetry | ||
#---------------------------------------------- | ||
# ----- install & configure poetry ----- | ||
#---------------------------------------------- | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
|
||
#---------------------------------------------- | ||
# run test suite | ||
#---------------------------------------------- | ||
- name: Test | ||
run: | | ||
export LD_LIBRARY_PATH=$PWD/TDengine/build/build/lib | ||
source $VENV | ||
poetry run pip install psutil pandas | ||
poetry run pytest tests | ||
- name: Build Artifacts | ||
|
@@ -108,10 +111,3 @@ jobs: | |
body_path: ${{ github.workflow }}-CHANGELOG.txt | ||
files: | | ||
dist/* | ||
- name: Publish to PyPI | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
poetry config pypi-token.pypi $PYPI_TOKEN | ||
poetry publish --build -n |