1#!/bin/bash 2 3set -ex 4 5rm -rf build 6mkdir build 7mkdir -p dist 8 9(cd "$(git rev-parse --show-toplevel)"; git archive HEAD) > build/tmp.tar 10cd build 11ln -s ../dist . 12 13mkdir nanopb 14tar xf tmp.tar README.md generator 15mv generator nanopb/ 16touch nanopb/__init__.py nanopb/generator/__init__.py 17make -C nanopb/generator/proto 18cp ../pyproject.toml . 19sed -i -e 's/\(version =.*\)-dev.*/\1-dev'$(git rev-list HEAD --count)'"/' pyproject.toml 20poetry build 21