mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-21 00:33:44 +08:00
9fb9b73620
# Conflicts: # README.md # SConstruct # conftest.py # docs/CARS.md # msgq_repo # opendbc_repo # openpilot/common/params_keys.h # openpilot/common/params_pyx.pyx # openpilot/common/tests/test_swaglog.cc # openpilot/selfdrive/car/card.py # openpilot/selfdrive/car/tests/test_car_interfaces.py # openpilot/selfdrive/car/tests/test_cruise_speed.py # openpilot/selfdrive/car/tests/test_models.py # openpilot/selfdrive/controls/controlsd.py # openpilot/selfdrive/controls/lib/latcontrol_torque.py # openpilot/selfdrive/controls/lib/longitudinal_planner.py # openpilot/selfdrive/controls/plannerd.py # openpilot/selfdrive/controls/radard.py # openpilot/selfdrive/controls/tests/test_longcontrol.py # openpilot/selfdrive/locationd/torqued.py # openpilot/selfdrive/modeld/modeld.py # openpilot/selfdrive/monitoring/dmonitoringd.py # openpilot/selfdrive/monitoring/test_monitoring.py # openpilot/selfdrive/selfdrived/selfdrived.py # openpilot/selfdrive/selfdrived/tests/test_alertmanager.py # openpilot/selfdrive/test/longitudinal_maneuvers/plant.py # openpilot/selfdrive/test/process_replay/migration.py # openpilot/selfdrive/test/process_replay/process_replay.py # openpilot/selfdrive/ui/feedback/feedbackd.py # openpilot/selfdrive/ui/layouts/settings/device.py # openpilot/selfdrive/ui/layouts/settings/toggles.py # openpilot/selfdrive/ui/mici/layouts/onboarding.py # openpilot/selfdrive/ui/onroad/augmented_road_view.py # openpilot/selfdrive/ui/tests/test_soundd.py # openpilot/selfdrive/ui/translations/app.pot # openpilot/selfdrive/ui/translations/app_de.po # openpilot/selfdrive/ui/translations/app_en.po # openpilot/selfdrive/ui/translations/app_es.po # openpilot/selfdrive/ui/translations/app_fr.po # openpilot/selfdrive/ui/translations/app_ja.po # openpilot/selfdrive/ui/translations/app_ko.po # openpilot/selfdrive/ui/translations/app_pt-BR.po # openpilot/selfdrive/ui/translations/app_th.po # openpilot/selfdrive/ui/translations/app_tr.po # openpilot/selfdrive/ui/translations/app_uk.po # openpilot/selfdrive/ui/translations/app_zh-CHS.po # openpilot/selfdrive/ui/translations/app_zh-CHT.po # openpilot/system/athena/athenad.py # openpilot/system/hardware/hardwared.py # openpilot/system/loggerd/deleter.py # openpilot/system/manager/process_config.py # openpilot/system/ui/lib/application.py # panda # pyproject.toml # tinygrad_repo # uv.lock
108 lines
2.7 KiB
Bash
Executable File
108 lines
2.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
set -x
|
|
|
|
# git diff --name-status origin/release3-staging | grep "^A" | less
|
|
|
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
|
|
|
cd $DIR
|
|
|
|
BUILD_DIR=/data/openpilot
|
|
SOURCE_DIR="$(git rev-parse --show-toplevel)"
|
|
|
|
if [ -z "$RELEASE_BRANCH" ]; then
|
|
echo "RELEASE_BRANCH is not set"
|
|
exit 1
|
|
fi
|
|
|
|
BUILD_BRANCH=release-mici-staging
|
|
|
|
|
|
# set git identity
|
|
source $DIR/identity.sh
|
|
|
|
echo "[-] Setting up repo T=$SECONDS"
|
|
rm -rf $BUILD_DIR
|
|
mkdir -p $BUILD_DIR
|
|
cd $BUILD_DIR
|
|
git init
|
|
git remote add origin git@github.com:commaai/openpilot.git
|
|
git checkout --orphan $BUILD_BRANCH
|
|
|
|
# do the files copy
|
|
echo "[-] copying files T=$SECONDS"
|
|
cd $SOURCE_DIR
|
|
cp -pR --parents $(./tools/release/release_files.py) $BUILD_DIR/
|
|
|
|
# in the directory
|
|
cd $BUILD_DIR
|
|
|
|
rm -f panda/board/obj/panda.bin.signed
|
|
rm -f panda/board/obj/panda_h7.bin.signed
|
|
|
|
VERSION=$(cat openpilot/sunnypilot/common/version.h | awk -F[\"-] '{print $2}')
|
|
echo "[-] committing version $VERSION T=$SECONDS"
|
|
git add -f .
|
|
git commit -a -m "openpilot v$VERSION release"
|
|
|
|
# Build and test before launch_chffrplus.sh creates the on-device package
|
|
# symlinks. SConstruct uses the same package roots for build subprocesses.
|
|
export PYTHONPATH="$BUILD_DIR:$BUILD_DIR/msgq_repo:$BUILD_DIR/opendbc_repo:$BUILD_DIR/rednose_repo:$BUILD_DIR/teleoprtc_repo:$BUILD_DIR/tinygrad_repo"
|
|
scons
|
|
|
|
if [ -z "$PANDA_DEBUG_BUILD" ]; then
|
|
# release panda fw
|
|
CERT=/data/pandaextra/certs/release RELEASE=1 scons panda/
|
|
else
|
|
# build with ALLOW_DEBUG=1 to enable features like experimental longitudinal
|
|
scons panda/
|
|
fi
|
|
|
|
# Ensure no submodules in release
|
|
if test "$(git submodule--helper list | wc -l)" -gt "0"; then
|
|
echo "submodules found:"
|
|
git submodule--helper list
|
|
exit 1
|
|
fi
|
|
git submodule status
|
|
|
|
# Cleanup
|
|
find . -name '*.a' -delete
|
|
find . -name '*.o' -delete
|
|
find . -name '*.os' -delete
|
|
find . -name '*.pyc' -delete
|
|
find . -name 'moc_*' -delete
|
|
find . -name '__pycache__' -delete
|
|
rm -rf .sconsign.dblite Jenkinsfile tools/release/
|
|
rm -f openpilot/selfdrive/modeld/models/*.onnx*
|
|
rm -f openpilot/sunnypilot/modeld*/models/*.onnx*
|
|
|
|
find openpilot/third_party/ -name '*x86*' -exec rm -r {} +
|
|
find openpilot/third_party/ -name '*Darwin*' -exec rm -r {} +
|
|
|
|
|
|
# Restore third_party
|
|
git checkout openpilot/third_party/
|
|
|
|
# Mark as prebuilt release
|
|
touch prebuilt
|
|
|
|
# Add built files to git
|
|
git add -f .
|
|
git commit --amend -m "openpilot v$VERSION"
|
|
|
|
# Run tests
|
|
cd $BUILD_DIR
|
|
RELEASE=1 ./openpilot/selfdrive/test/test_onroad.py
|
|
#tools/test_runner.py openpilot/selfdrive/car/tests/test_car_interfaces.py
|
|
|
|
echo "[-] pushing release T=$SECONDS"
|
|
REFS=()
|
|
for branch in ${RELEASE_BRANCH//,/ }; do
|
|
REFS+=("$BUILD_BRANCH:$branch")
|
|
done
|
|
git push -f origin "${REFS[@]}"
|
|
|
|
echo "[-] done T=$SECONDS"
|