add cache store stats #161
Workflow file for this run
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
name: client apis | |
on: | |
push: | |
tags: | |
- "v*" | |
paths: | |
- "hstream.proto" | |
- "api/python/**" | |
pull_request: | |
jobs: | |
pre-build: | |
runs-on: ubuntu-latest | |
name: prepare pre-build environment | |
outputs: | |
PACKAGE_VERSION: ${{ steps.parser.outputs.PACKAGE_VERSION }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: "recursive" | |
- id: parser | |
run: | | |
VERSION="$(echo ${GITHUB_REF#refs/*/} | gawk 'match($0, /^v([0-9]+\.[0-9]+\.[0-9]+)/, xs) {print xs[1]}')" | |
test -z "$VERSION" && VERSION="0.0.0" # set fake version for pr | |
echo "Set package versions: $VERSION..." | |
echo "::set-output name=PACKAGE_VERSION::$VERSION" | |
python: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, 'skip apis')" | |
needs: pre-build | |
env: | |
PACKAGE_VERSION: ${{ needs.pre-build.outputs.PACKAGE_VERSION }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: "recursive" | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.7' | |
- name: install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip install -U grpcio-tools build wheel twine | |
- name: build | |
run: | | |
cd api | |
python3 -m grpc_tools.protoc -I ./protos \ | |
--python_out=python/src \ | |
--grpc_python_out=python/src \ | |
./protos/HStream/Server/HStreamApi.proto | |
cd python | |
sed "s/__VERSION__/${PACKAGE_VERSION}/g" setup_temp.py > setup.py | |
python3 -m build --no-isolation | |
twine check --strict dist/* | |
- name: upload | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
cd api/python | |
twine upload --skip-existing -u __token__ -p "${{ secrets.PYPI_API_TOKEN }}" dist/* |