forked from windmill-labs/windmill
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·43 lines (31 loc) · 1.57 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·43 lines (31 loc) · 1.57 KB
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
#!/bin/bash
set -e
mkdir openapi || true
cp ../backend/windmill-api/openapi.yaml openapi/openapi.yaml
npx @redocly/openapi-cli@latest bundle openapi/openapi.yaml > openapi-bundled.yaml
sed -z 's/FlowModuleValue:/FlowModuleValue2:/' openapi-bundled.yaml > openapi-decycled.yaml
echo " FlowModuleValue: {}" >> openapi-decycled.yaml
npx @redocly/openapi-cli@latest bundle openapi-decycled.yaml --ext json -d > openapi-deref.json
sed '$d' .gitignore > .gitignore2
mv .gitignore2 .gitignore
rm -rf windmill-api/ || true
openapi-python-client generate --config $PWD/python-gen.yaml --path openapi-deref.json
echo "" > windmill-api/windmill_api/models/__init__.py
rm -rf openapi/
rm openapi*
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
cd .. && echo "windmill-api/" >> .gitignore