diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-01-21 14:04:56 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-01-21 14:09:00 +1100 |
| commit | 393b268e159a40b23bc63464f4d04d5be09e070f (patch) | |
| tree | d78167662cd68de3e08d90bb1b44070ab542e433 /lib/cbor/tinycbor/scripts/update-docs.sh | |
| parent | bb50cf52cd8984704b757b1e5f9e11a126b24eba (diff) | |
| download | tangara-fw-393b268e159a40b23bc63464f4d04d5be09e070f.tar.gz | |
Vendor tinycbor, since v5 no longer includes it
Diffstat (limited to 'lib/cbor/tinycbor/scripts/update-docs.sh')
| -rwxr-xr-x | lib/cbor/tinycbor/scripts/update-docs.sh | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/cbor/tinycbor/scripts/update-docs.sh b/lib/cbor/tinycbor/scripts/update-docs.sh new file mode 100755 index 00000000..19acfaea --- /dev/null +++ b/lib/cbor/tinycbor/scripts/update-docs.sh @@ -0,0 +1,52 @@ +#!/bin/sh -ex +tuple="$TRAVIS_BRANCH${TRAVIS_TAG:+tag:$TRAVIS_TAG},$TRAVIS_PULL_REQUEST" +case "$tuple" in + dev,false|main,false|tag:*) + ;; + *) + exit 0 + ;; +esac +V=`cut -f1-2 -d. <VERSION` +git fetch origin gh-pages + +# Fail if the library sizes file isn't present +test -r sizes + +# Run doxygen (maybe) +if [ -n "${TRAVIS_TAG-$FORCE_DOCS}" ] && make -s docs 2>/dev/null; then + git checkout -b gh-pages FETCH_HEAD + if [ -d "$V" ]; then + mv "$V" "old-$V" + fi + mv doc/html "$V" + git add -A "$V" +else + git checkout -b gh-pages FETCH_HEAD + mkdir -p "$V" +fi + +# Update the symlink for the branch name +rm -f "./$TRAVIS_BRANCH" +ln -s "$V" "$TRAVIS_BRANCH" +git add "./$TRAVIS_BRANCH" + +# Update the library sizes file +# (will fail if the release build failed) +mkdir -p "library_sizes/$TRAVIS_BRANCH" +mv sizes "library_sizes/$TRAVIS_BRANCH/$QMAKESPEC" +(cd "library_sizes/$TRAVIS_BRANCH/"; + for f in *; do echo "$f:"; cat "$f" ; done) > "$V/library_sizes.txt" +git add "library_sizes/$TRAVIS_BRANCH" "$V/library_sizes.txt" +git diff --cached -U0 "$V/library_sizes.txt" + +# Commit everything +if git commit -m "Update docs for $V (Travis build $TRAVIS_BUILD_NUMBER) + +Matching commit $TRAVIS_COMMIT: +$TRAVIS_COMMIT_MESSAGE"; then + # We've made a commit, push it + set +x + url=`git config --get remote.origin.url | sed -e s,://github,://$GITHUB_AUTH@github,` + git push "$url" @:gh-pages +fi |
