-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from Boavizta/dev
Merging v1 into main
- Loading branch information
Showing
192 changed files
with
57,577 additions
and
7,260 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
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,84 @@ | ||
name: build_client_sdk_with_poetry | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'test/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- 'LICENSE' | ||
- 'Dockerfile' | ||
- 'CITATION' | ||
- 'book.toml' | ||
- 'CONTRIBUTING.md' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
name: build_python_client_sdk | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Install pipenv | ||
run: | | ||
python -m pip install --upgrade poetry wheel twine | ||
- id: cache-pipenv | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.local/share/virtualenvs | ||
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-pipenv.outputs.cache-hit != 'true' | ||
run: | | ||
make install | ||
- name: Build local api package | ||
run: make build | ||
|
||
- name: Build the api Docker image | ||
run: docker build --build-arg VERSION=$(poetry version -s) . --file Dockerfile --tag boaviztapi:latest | ||
|
||
- name: Run the API locally | ||
run: | | ||
docker run -p "5000:5000" --name=boaviztapi -tid boaviztapi:latest | ||
- name: Get logs from the API container in case of a failure | ||
run: | | ||
docker logs boaviztapi | ||
- name: Get the openapi.json definition and generate the code | ||
run: | | ||
while [[ ! $(docker ps | grep boaviztapi) ]]; do sleep 1; echo "Waiting for BoaviztAPI container to boot"; done | ||
wget http://127.0.0.1:5000/openapi.json | ||
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate -i /local/openapi.json -g python -o /local/boaviztapi_sdk --package-name boaviztapi_sdk | ||
# Publish client SDK package | ||
- name: Build the pip package and push it | ||
run: | | ||
sudo chown -R $(whoami) boaviztapi_sdk | ||
SDK_VERSION=$(poetry version -s) | ||
echo "SDK_VERSION == ${SDK_VERSION}" | ||
cd boaviztapi_sdk | ||
sed -i "s/^VERSION.*/VERSION = \"${SDK_VERSION}\"/" setup.py | ||
sed -i "s/^ long_description=.*/ long_description='Python SDK for boaviztAPI',/" setup.py | ||
sed -i '/ <p>.*/d' setup.py | ||
sed -i '/ """.*/d' setup.py | ||
python3 setup.py sdist | ||
# Publish | ||
pip3 install pipenv twine | ||
pipenv run twine upload --repository pypi --username __token__ --password ${{ secrets.BPETIT_SECRET_PYPI_TOKEN }} dist/* | ||
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
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
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
Oops, something went wrong.