Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test_sitl_copter.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: test copter

on: [push, pull_request, workflow_dispatch]
on: [push, workflow_dispatch]
# paths:
# - "*"
# - "!README.md" <-- don't rebuild on doc change
Expand Down
21 changes: 17 additions & 4 deletions Tools/scripts/mttr-build-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,21 @@ echo $PATH
./waf configure --board=sitl --debug --enable-opendroneid
./waf copter

mv build/MttrCubeBlack/bin/arducopter.apj "/tmp/deploy_files/copter-MttrCubeBlack.apj"
mv build/MttrCubeOrange/bin/arducopter.apj "/tmp/deploy_files/copter-MttrCubeOrange.apj"
mv build/MttrCubeBlack/bin/arducopter "/tmp/deploy_files/copter-MttrCubeBlack.elf"
mv build/MttrCubeOrange/bin/arducopter "/tmp/deploy_files/copter-MttrCubeOrange.elf"
# Get Ardupilot version
eval $(sed -n 's/^#define *\([^ ]*\) *\(.*\) *$/export \1=\2/p' ArduCopter/version.h)

# Get mttr git tag (replace all dashes with underscores)
git fetch --tags --no-recurse-submodules
MTTR_GIT_TAG=$(echo $(git tag -l "mttr-*" --sort=-committerdate | head -1) | tr - _)

# Get mttr git hash
MTTR_GIT_HASH=$(git rev-parse --short=7 HEAD)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this gets run is very important. It must be run after the commit gets merged to the main for this to work. If you can run a test that shows the hash is correct we can leave this in. Otherwise it will cause way more confusion than its worth.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I ensured that it worked well on my pc, but I'm not sure it was right from circleci. I'm looking into this.

Copy link
Contributor Author

@bhiln bhiln Jan 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robkarol Here's the latest push with correct hash in the files: https://github.com/matternet/ardupilot/actions/runs/4008770308
image
image


# Create version string
VERSION_DESCRIPTION="ap_${FW_MAJOR}.${FW_MINOR}.${FW_PATCH}-${MTTR_GIT_TAG}-${MTTR_GIT_HASH}"

mv build/MttrCubeBlack/bin/arducopter.apj "/tmp/deploy_files/copter-${VERSION_DESCRIPTION}-MttrCubeBlack.apj"
mv build/MttrCubeOrange/bin/arducopter.apj "/tmp/deploy_files/copter-${VERSION_DESCRIPTION}-MttrCubeOrange.apj"
mv build/MttrCubeBlack/bin/arducopter "/tmp/deploy_files/copter-${VERSION_DESCRIPTION}-MttrCubeBlack.elf"
mv build/MttrCubeOrange/bin/arducopter "/tmp/deploy_files/copter-${VERSION_DESCRIPTION}-MttrCubeOrange.elf"
mv build/sitl/bin/arducopter "/tmp/deploy_files/sitl.elf"