Files
windmill/python-client/build.sh
T
Ruben Fiszel 6cbc6b421b feat: add go LSP (#699)
* lsp

* progress

* 1.36.0
2022-10-08 13:28:46 +02:00

38 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
set -e
#TODO: remove once openapi-python-client supports recursive values
cp ../openflow.openapi.yaml ../openflow.openapi.yaml.tmp
sed -z 's/ ForloopFlow:\n type: object\n properties:\n modules:\n type: array\n items:\n $ref: "#\/components\/schemas\/FlowModule"/ ForloopFlow:\n type: object\n properties:/' ../openflow.openapi.yaml > ../openflow.openapi.yaml.new
mv ../openflow.openapi.yaml.new ../openflow.openapi.yaml
cp ../backend/openapi.yaml openapi.yaml
swagger-cli bundle -r openapi.yaml -o openapi-deref.yaml
rm openapi.yaml && mv ../openflow.openapi.yaml.tmp ../openflow.openapi.yaml
rm -rf windmill-api/ || true
openapi-python-client generate --config $PWD/python-gen.yaml --path openapi-deref.yaml
cp LICENSE windmill-api/
sed -i '5 i license = "Apache-2.0"' windmill-api/pyproject.toml
sed -i 's/authors = \[\]/authors = \["Ruben Fiszel <ruben@windmill.dev>"\]/g' windmill-api/pyproject.toml
echo "# Autogenerated Windmill OpenApi Client" >> windmill-api/README.md.tmp
echo "This is the raw autogenerated api client. You are most likely more interested \
in [wmill](https://pypi.org/project/wmill/) which leverages this client to offer an \
user friendly experience. We use \
[this openapi python client generator](https://github.com/openapi-generators/openapi-python-client/)"\
>> windmill-api/README.md.tmp
echo "" >> windmill-api/README.md.tmp
head -n -13 windmill-api/README.md >> windmill-api/README.md.tmp
mv windmill-api/README.md.tmp windmill-api/README.md
cd windmill-api && poetry build
cd ../wmill && poetry build
cd ../wmill_pg && poetry build