mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
FrogPilot 0.9.7
This commit is contained in:
@@ -0,0 +1,270 @@
|
||||
name: Compile FrogPilot
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
not_vetted:
|
||||
description: "This branch is not vetted"
|
||||
required: false
|
||||
default: "false"
|
||||
type: boolean
|
||||
publish_frogpilot:
|
||||
description: "Push to FrogPilot"
|
||||
required: false
|
||||
default: "false"
|
||||
type: boolean
|
||||
publish_staging:
|
||||
description: "Push to FrogPilot-Staging"
|
||||
required: false
|
||||
default: "false"
|
||||
type: boolean
|
||||
publish_testing:
|
||||
description: "Push to FrogPilot-Testing"
|
||||
required: false
|
||||
default: "false"
|
||||
type: boolean
|
||||
publish_custom_branch:
|
||||
description: "Push to custom branch:"
|
||||
required: false
|
||||
default: ""
|
||||
type: string
|
||||
update_translations:
|
||||
description: "Update missing/outdated translations"
|
||||
required: false
|
||||
default: "false"
|
||||
type: boolean
|
||||
vet_existing_translations:
|
||||
description: "Vet existing translations"
|
||||
required: false
|
||||
default: "false"
|
||||
type: boolean
|
||||
|
||||
env:
|
||||
BASEDIR: "${{ github.workspace }}"
|
||||
BUILD_DIR: /data/openpilot
|
||||
OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}"
|
||||
|
||||
jobs:
|
||||
get_branch:
|
||||
runs-on: [self-hosted, c3x]
|
||||
outputs:
|
||||
branch: ${{ steps.get_branch.outputs.branch }}
|
||||
python_version: ${{ steps.get_python_version.outputs.python_version }}
|
||||
steps:
|
||||
- name: Determine Current Branch on Runner
|
||||
id: get_branch
|
||||
run: |
|
||||
cd $BUILD_DIR
|
||||
|
||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Get Python Version from Runner
|
||||
id: get_python_version
|
||||
run: |
|
||||
PYTHON_VERSION=$(tr -d '[:space:]' < "$BUILD_DIR/.python-version")
|
||||
echo "python_version=$PYTHON_VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
translate:
|
||||
if: inputs.update_translations
|
||||
needs: get_branch
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Configure Git Identity
|
||||
run: |
|
||||
git config --global user.name "James"
|
||||
git config --global user.email "91348155+FrogAi@users.noreply.github.com"
|
||||
|
||||
- name: Checkout Required Files
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ needs.get_branch.outputs.branch }}
|
||||
sparse-checkout: |
|
||||
frogpilot/ui/
|
||||
selfdrive/controls/lib/alerts_offroad.json
|
||||
selfdrive/ui/
|
||||
selfdrive/ui/update_translations.py
|
||||
selfdrive/ui/translations/
|
||||
selfdrive/ui/translations/auto_translate.py
|
||||
|
||||
- name: Set Up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "${{ needs.get_branch.outputs.python_version }}"
|
||||
|
||||
- name: Install Dependencies
|
||||
run: pip install requests
|
||||
|
||||
- name: Install Qt5 Tools
|
||||
run: sudo apt update && sudo apt install -y qttools5-dev-tools
|
||||
|
||||
- name: Update Translations
|
||||
run: python selfdrive/ui/update_translations.py --vanish
|
||||
|
||||
- name: Update Missing Translations
|
||||
continue-on-error: true
|
||||
run: python selfdrive/ui/translations/auto_translate.py --all-files
|
||||
timeout-minutes: 300
|
||||
|
||||
- name: Vet Existing Translations
|
||||
if: github.event.inputs.vet_existing_translations == 'true'
|
||||
run: python selfdrive/ui/translations/auto_translate.py --all-files --vet-translations
|
||||
|
||||
- name: Commit and Push Translation Updates
|
||||
run: |
|
||||
if git diff --quiet selfdrive/ui/translations/*.ts; then
|
||||
echo "No translation updates detected."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git fetch --unshallow origin ${{ needs.get_branch.outputs.branch }}
|
||||
git checkout ${{ needs.get_branch.outputs.branch }}
|
||||
git add selfdrive/ui/translations/*.ts
|
||||
git commit --amend --no-edit
|
||||
git push --force origin ${{ needs.get_branch.outputs.branch }}
|
||||
|
||||
build_and_push:
|
||||
needs:
|
||||
- get_branch
|
||||
- translate
|
||||
if: always()
|
||||
runs-on: [self-hosted, c3x]
|
||||
permissions:
|
||||
contents: write
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ env.BUILD_DIR }}
|
||||
steps:
|
||||
- name: Configure Git Identity
|
||||
run: |
|
||||
git config --global http.postBuffer 104857600
|
||||
|
||||
git config --global user.name "James"
|
||||
git config --global user.email "91348155+FrogAi@users.noreply.github.com"
|
||||
|
||||
- name: Update Repository
|
||||
run: |
|
||||
git remote set-url origin https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/FrogAi/FrogPilot.git
|
||||
|
||||
if [ "${{ github.event.inputs.update_translations }}" = "true" ]; then
|
||||
git fetch origin ${{ needs.get_branch.outputs.branch }}
|
||||
git reset --hard FETCH_HEAD
|
||||
fi
|
||||
|
||||
- name: Take Ownership of Build
|
||||
run: |
|
||||
sudo chown -R $(whoami):$(whoami) .
|
||||
|
||||
- name: Finalize Build
|
||||
run: |
|
||||
rm -f .clang-tidy
|
||||
rm -f .dockerignore
|
||||
rm -f .editorconfig
|
||||
rm -f .gitattributes
|
||||
rm -f .gitmodules
|
||||
rm -f .lfsconfig
|
||||
rm -f .overlay_init
|
||||
rm -f .pre-commit-config.yaml
|
||||
rm -f .sconsign.dblite
|
||||
rm -f codecov.yml
|
||||
rm -f conftest.py
|
||||
rm -f poetry.lock
|
||||
rm -f pyproject.toml
|
||||
rm -f teleoprtc
|
||||
rm -f Dockerfile.openpilot
|
||||
rm -f Dockerfile.openpilot_base
|
||||
rm -f Jenkinsfile
|
||||
|
||||
rm -f panda/board/obj/.placeholder
|
||||
rm -f panda/board/obj/bootstub.panda.elf
|
||||
rm -f panda/board/obj/bootstub.panda_h7.elf
|
||||
rm -f panda/board/obj/panda.bin
|
||||
rm -f panda/board/obj/panda.elf
|
||||
rm -f panda/board/obj/panda_h7.bin
|
||||
rm -f panda/board/obj/panda_h7.elf
|
||||
rm -f panda/board/obj/version
|
||||
|
||||
find . -name '*.a' -delete
|
||||
find . -name '*.cc' -delete
|
||||
find . -name '*.o' -delete
|
||||
find . -name '*.onnx' -delete
|
||||
find . -name '*.os' -delete
|
||||
find . -name '*.pyc' -delete
|
||||
find . -name 'moc_*' -delete
|
||||
|
||||
find . -name '*.h' | while read -r header; do
|
||||
if [[ "$header" != *"common/version.h" && "$header" != *"system/camerad/sensors/"* ]]; then
|
||||
rm -f "$header"
|
||||
fi
|
||||
done
|
||||
|
||||
rm -rf .devcontainer/
|
||||
rm -rf .vscode/
|
||||
rm -rf body/
|
||||
rm -rf opendbc/generator/
|
||||
rm -rf release/
|
||||
rm -rf scripts/
|
||||
rm -rf site_scons/
|
||||
rm -rf teleoprtc_repo/
|
||||
|
||||
find .github -mindepth 1 -maxdepth 1 ! -name 'workflows' -exec rm -rf {} +
|
||||
|
||||
find .github/workflows -mindepth 1 ! \( \
|
||||
-type f \( \
|
||||
-name 'compile_frogpilot.yaml' -o \
|
||||
-name 'review_pull_request.yaml' -o \
|
||||
-name 'schedule_update.yaml' -o \
|
||||
-name 'update_pr_branch.yaml' -o \
|
||||
-name 'update_release_branch.yaml' \
|
||||
-name 'update_tinygrad.yaml' \
|
||||
\) \
|
||||
\) -exec rm -rf {} +
|
||||
|
||||
find panda/board/jungle -type f ! -name '__init__.py' -delete
|
||||
find panda/board/jungle -type d -empty -delete
|
||||
|
||||
find third_party/ -name '*x86*' -exec rm -rf {} +
|
||||
find third_party/ -name '*Darwin*' -exec rm -rf {} +
|
||||
|
||||
find tools/ -mindepth 1 -maxdepth 1 ! \( -name '__init__.py' -o -name 'bodyteleop' -o -name 'lib' -o -name 'scripts' \) -exec rm -rf {} +
|
||||
|
||||
find . -name 'SConstruct' -delete
|
||||
find . -name 'SConscript' -delete
|
||||
|
||||
find . -type d \( -iname "debug" -o -iname "test" -o -iname "tests" \) -exec rm -rf {} +
|
||||
find . -type d -empty ! -path "./.git*" -delete
|
||||
find . -type d -name '__pycache__' -exec rm -rf {} +
|
||||
find . -type f -regex '.*matlab.*\.md' -delete
|
||||
|
||||
touch prebuilt
|
||||
|
||||
if [ "${{ github.event.inputs.not_vetted }}" = "true" ]; then
|
||||
touch not_vetted
|
||||
fi
|
||||
|
||||
- name: Add the update_date file
|
||||
if: github.event.inputs.publish_staging == 'true'
|
||||
run: |
|
||||
curl -fLsS https://raw.githubusercontent.com/FrogAi/FrogPilot/FrogPilot-Staging/.github/update_date -o .github/update_date || echo "No update_date found, skipping."
|
||||
|
||||
- name: Commit Build
|
||||
run: |
|
||||
git add -f .
|
||||
git commit -m "Compile FrogPilot"
|
||||
git push --force origin HEAD
|
||||
|
||||
if [ "${{ github.event.inputs.publish_frogpilot }}" = "true" ]; then
|
||||
git push --force origin HEAD:"FrogPilot"
|
||||
fi
|
||||
|
||||
if [ "${{ github.event.inputs.publish_staging }}" = "true" ]; then
|
||||
git push --force origin HEAD:"FrogPilot-Staging"
|
||||
fi
|
||||
|
||||
if [ "${{ github.event.inputs.publish_testing }}" = "true" ]; then
|
||||
git push --force origin HEAD:"FrogPilot-Testing"
|
||||
fi
|
||||
|
||||
if [ -n "${{ github.event.inputs.publish_custom_branch }}" ]; then
|
||||
git push --force origin HEAD:"${{ github.event.inputs.publish_custom_branch }}"
|
||||
fi
|
||||
@@ -0,0 +1,34 @@
|
||||
name: Review Pull Request
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, reopened]
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
|
||||
jobs:
|
||||
pr_check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Exit If PR Opened by FrogAi
|
||||
if: ${{ github.actor == 'FrogAi' }}
|
||||
run: |
|
||||
echo PR opened or reopened by FrogAi. No action needed.
|
||||
exit 0
|
||||
|
||||
- name: Close PR for Invalid Target Branch
|
||||
if: ${{ github.base_ref != 'MAKE-PRS-HERE' }}
|
||||
run: |
|
||||
gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
|
||||
-f body="Please submit your pull request to the \"MAKE-PRS-HERE\" branch."
|
||||
|
||||
gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} \
|
||||
-X PATCH \
|
||||
-f state="closed"
|
||||
|
||||
- name: Acknowledge PR for Valid Target Branch
|
||||
if: ${{ github.base_ref == 'MAKE-PRS-HERE' }}
|
||||
run: |
|
||||
gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
|
||||
-f body="Thank you for your PR! If you're not already in the FrogPilot Discord, [feel free to join](https://discord.FrogPilot.download) and let me know you've opened a PR!"
|
||||
@@ -0,0 +1,57 @@
|
||||
name: Schedule FrogPilot Update
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
scheduled_date:
|
||||
description: "Enter the date to update the \"FrogPilot\" branch (YYYY-MM-DD)"
|
||||
required: true
|
||||
|
||||
env:
|
||||
BRANCH: FrogPilot-Staging
|
||||
|
||||
jobs:
|
||||
schedule-update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Configure Git Identity
|
||||
run: |
|
||||
git config --global user.name "James"
|
||||
git config --global user.email "91348155+FrogAi@users.noreply.github.com"
|
||||
|
||||
- name: Checkout ${{ env.BRANCH }}
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ env.BRANCH }}
|
||||
fetch-depth: 3
|
||||
|
||||
- name: Schedule Update for ${{ github.event.inputs.scheduled_date }}
|
||||
run: |
|
||||
echo "${{ github.event.inputs.scheduled_date }}" > .github/update_date
|
||||
git add .github/update_date
|
||||
|
||||
- name: Get Target Commit (Second Most Recent)
|
||||
id: get_target
|
||||
run: |
|
||||
TARGET_COMMIT=$(git rev-parse HEAD~1)
|
||||
|
||||
AUTHOR_DATE=$(git show -s --format=%aD "$TARGET_COMMIT")
|
||||
COMMITTER_DATE=$(git show -s --format=%cD "$TARGET_COMMIT")
|
||||
|
||||
echo "AUTHOR_DATE=$AUTHOR_DATE" >> $GITHUB_ENV
|
||||
echo "COMMITTER_DATE=$COMMITTER_DATE" >> $GITHUB_ENV
|
||||
echo "TARGET_COMMIT=$TARGET_COMMIT" >> $GITHUB_ENV
|
||||
|
||||
- name: Create Fixup Commit for ${{ env.TARGET_COMMIT }}
|
||||
run: git commit --fixup="${{ env.TARGET_COMMIT }}"
|
||||
|
||||
- name: Autosquash Fixup into Target Commit
|
||||
run: |
|
||||
GIT_SEQUENCE_EDITOR=: git rebase --autosquash -i HEAD~3
|
||||
|
||||
- name: Restore Timestamps on Final Two Commits
|
||||
run: |
|
||||
git rebase --exec "GIT_COMMITTER_DATE='${{ env.COMMITTER_DATE }}' git commit --amend --no-edit --date='${{ env.AUTHOR_DATE }}'" HEAD~2
|
||||
|
||||
- name: Push Updated ${{ env.BRANCH }} Branch
|
||||
run: git push origin "${{ env.BRANCH }}" --force-with-lease
|
||||
@@ -0,0 +1,85 @@
|
||||
name: Update MAKE-PRS-HERE
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- FrogPilot-Staging
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
|
||||
SOURCE_BRANCH: FrogPilot-Staging
|
||||
TARGET_BRANCH: MAKE-PRS-HERE
|
||||
|
||||
jobs:
|
||||
update_branch:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Configure Git Identity
|
||||
run: |
|
||||
git config --global user.name "James"
|
||||
git config --global user.email "91348155+FrogAi@users.noreply.github.com"
|
||||
|
||||
- name: Checkout ${{ env.SOURCE_BRANCH }}
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
fetch-depth: 0
|
||||
|
||||
ref: ${{ env.SOURCE_BRANCH }}
|
||||
|
||||
- name: Find "Compile FrogPilot" Commit in ${{ env.SOURCE_BRANCH }}
|
||||
id: find_parent
|
||||
run: |
|
||||
COMMIT=$(git rev-list HEAD -n 1 --grep="Compile FrogPilot")
|
||||
[ -z "$COMMIT" ] && echo "Compile commit not found." >&2 && exit 1
|
||||
|
||||
PARENT=$(git rev-list --parents -n 1 "$COMMIT" | awk '{print $2}')
|
||||
[ -z "$PARENT" ] && echo "Parent commit not found." >&2 && exit 1
|
||||
|
||||
echo "parent_commit=$PARENT" >> "$GITHUB_OUTPUT"
|
||||
echo "compile_commit=$COMMIT" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Fetch and Checkout ${{ env.TARGET_BRANCH }}
|
||||
run: |
|
||||
git fetch origin "${{ env.TARGET_BRANCH }}"
|
||||
git checkout "${{ env.TARGET_BRANCH }}"
|
||||
|
||||
- name: Clean ${{ env.TARGET_BRANCH }} and Apply Updates from ${{ env.SOURCE_BRANCH }}
|
||||
run: |
|
||||
git rm -r --ignore-unmatch .
|
||||
git clean -fdx
|
||||
git checkout "${{ steps.find_parent.outputs.parent_commit }}" -- .
|
||||
|
||||
COMPILE_COMMIT="${{ steps.find_parent.outputs.compile_commit }}"
|
||||
SOURCE_HEAD=$(git rev-parse "origin/${{ env.SOURCE_BRANCH }}")
|
||||
|
||||
[ "$COMPILE_COMMIT" != "$SOURCE_HEAD" ] && git cherry-pick --no-commit "${COMPILE_COMMIT}".."$SOURCE_HEAD"
|
||||
|
||||
rm -f .github/update_date
|
||||
|
||||
git add --all
|
||||
|
||||
- name: Commit and Push to ${{ env.TARGET_BRANCH }}
|
||||
run: |
|
||||
TZ_VALUE="America/Phoenix"
|
||||
day=$(TZ="$TZ_VALUE" date +"%-d")
|
||||
month=$(TZ="$TZ_VALUE" date +"%B")
|
||||
year=$(TZ="$TZ_VALUE" date +"%Y")
|
||||
|
||||
case $day in
|
||||
11|12|13) s=th ;;
|
||||
*) case $((day % 10)) in 1) s=st ;; 2) s=nd ;; 3) s=rd ;; *) s=th ;; esac ;;
|
||||
esac
|
||||
|
||||
commit_message="${month} ${day}${s}, ${year} Update"
|
||||
|
||||
if git log -1 --pretty=%s | grep -q "$commit_message"; then
|
||||
git commit --amend --no-edit
|
||||
else
|
||||
git commit -m "$commit_message"
|
||||
fi
|
||||
|
||||
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
|
||||
git push origin "${{ env.TARGET_BRANCH }}" --force
|
||||
@@ -0,0 +1,127 @@
|
||||
name: Update FrogPilot Branch
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 18 * * 6"
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
|
||||
BRANCH_FROGPILOT: FrogPilot
|
||||
BRANCH_PREVIOUS: FrogPilot-Previous
|
||||
BRANCH_STAGING: FrogPilot-Staging
|
||||
|
||||
TZ: America/Phoenix
|
||||
|
||||
UPDATE_FILE: .github/update_date
|
||||
|
||||
jobs:
|
||||
check_update:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
update_due: ${{ steps.check_update.outputs.update_due }}
|
||||
scheduled_date: ${{ steps.check_update.outputs.scheduled_date }}
|
||||
steps:
|
||||
- name: Download the "update_date" File
|
||||
id: download_update
|
||||
run: |
|
||||
curl -fLsS "https://raw.githubusercontent.com/FrogAi/FrogPilot/${{ env.BRANCH_STAGING }}/${{ env.UPDATE_FILE }}" -o update_date || touch update_date_missing
|
||||
|
||||
- name: Check If Update Is Due
|
||||
id: check_update
|
||||
run: |
|
||||
if [ -f update_date_missing ]; then
|
||||
echo "update_due=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
SCHEDULED_DATE=$(cat update_date)
|
||||
CURRENT_DATE=$(TZ="${{ env.TZ }}" date +%F)
|
||||
|
||||
if [ "$SCHEDULED_DATE" != "$CURRENT_DATE" ]; then
|
||||
echo "update_due=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "update_due=true" >> "$GITHUB_OUTPUT"
|
||||
echo "scheduled_date=$SCHEDULED_DATE" >> "$GITHUB_OUTPUT"
|
||||
|
||||
update_branch:
|
||||
needs: check_update
|
||||
if: ${{ needs.check_update.outputs.update_due == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Configure Git Identity
|
||||
run: |
|
||||
git config --global user.name "James"
|
||||
git config --global user.email "91348155+FrogAi@users.noreply.github.com"
|
||||
|
||||
- name: Checkout ${{ env.BRANCH_STAGING }}
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ env.BRANCH_STAGING }}
|
||||
|
||||
- name: Authenticate with GITHUB_TOKEN
|
||||
run: |
|
||||
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
|
||||
|
||||
- name: Update README Date and Remove update file
|
||||
run: |
|
||||
DAY=$(TZ="${{ env.TZ }}" date +'%d' | sed 's/^0//')
|
||||
case "$DAY" in
|
||||
1|21|31) SUFFIX="st" ;;
|
||||
2|22) SUFFIX="nd" ;;
|
||||
3|23) SUFFIX="rd" ;;
|
||||
*) SUFFIX="th" ;;
|
||||
esac
|
||||
MONTH=$(TZ="${{ env.TZ }}" date +'%B')
|
||||
YEAR=$(TZ="${{ env.TZ }}" date +'%Y')
|
||||
NEW_DATE="**${MONTH} ${DAY}${SUFFIX}, ${YEAR}**"
|
||||
|
||||
sed -i "/FrogPilot was last updated on:/ { N; N; s/\(\n\)\n.*$/\1\n${NEW_DATE}/; }" README.md
|
||||
|
||||
git add README.md
|
||||
git rm -f "${{ env.UPDATE_FILE }}"
|
||||
git commit -m "Updated README date to ${NEW_DATE}"
|
||||
|
||||
- name: Squash Commits
|
||||
run: |
|
||||
COMMIT_MSG=$(git log -1 --pretty=%B HEAD~1)
|
||||
|
||||
git reset --soft HEAD~2
|
||||
git commit -m "$COMMIT_MSG"
|
||||
|
||||
- name: Rewrite Commit Dates to Noon ${{ env.TZ }}
|
||||
run: |
|
||||
COMMIT_DATETIME="${{ needs.check_update.outputs.scheduled_date }} 12:00"
|
||||
COMMIT_PHX=$(TZ="${{ env.TZ }}" date -d "$COMMIT_DATETIME" +"%Y-%m-%dT%H:%M:%S %z")
|
||||
|
||||
git filter-branch --env-filter "export GIT_AUTHOR_DATE='$COMMIT_PHX'; export GIT_COMMITTER_DATE='$COMMIT_PHX'" "${{ env.BRANCH_STAGING }}"
|
||||
|
||||
- name: Fetch ${{ env.BRANCH_PREVIOUS }} and ${{ env.BRANCH_FROGPILOT }}
|
||||
run: |
|
||||
git fetch origin ${{ env.BRANCH_PREVIOUS }} ${{ env.BRANCH_FROGPILOT }}
|
||||
|
||||
- name: Wait Until Noon ${{ env.TZ }}
|
||||
run: |
|
||||
NOW=$(TZ="${{ env.TZ }}" date +%s)
|
||||
TARGET=$(TZ="${{ env.TZ }}" date -d "12:00" +%s)
|
||||
|
||||
[ "$NOW" -lt "$TARGET" ] && sleep $((TARGET - NOW))
|
||||
|
||||
- name: Push ${{ env.BRANCH_STAGING }}
|
||||
run: |
|
||||
git push origin "${{ env.BRANCH_STAGING }}" --force
|
||||
|
||||
- name: Reset ${{ env.BRANCH_PREVIOUS }} to Match ${{ env.BRANCH_FROGPILOT }}
|
||||
run: |
|
||||
git switch "${{ env.BRANCH_PREVIOUS }}"
|
||||
git reset --hard "origin/${{ env.BRANCH_FROGPILOT }}"
|
||||
git push origin "${{ env.BRANCH_PREVIOUS }}" --force
|
||||
|
||||
- name: Reset ${{ env.BRANCH_FROGPILOT }} to Match ${{ env.BRANCH_STAGING }}
|
||||
run: |
|
||||
git switch "${{ env.BRANCH_FROGPILOT }}"
|
||||
git reset --hard "origin/${{ env.BRANCH_STAGING }}"
|
||||
git push origin "${{ env.BRANCH_FROGPILOT }}" --force
|
||||
@@ -0,0 +1,57 @@
|
||||
name: Update Tinygrad
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update_tinygrad:
|
||||
name: Update Tinygrad
|
||||
runs-on: [self-hosted, c3x]
|
||||
|
||||
steps:
|
||||
- name: Get version
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=$(grep -oP '^VERSION\s*=\s*"\K[^"]+' /data/openpilot/frogpilot/assets/model_manager.py)
|
||||
echo "VERSION=$VERSION"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Clone GitLab repo
|
||||
env:
|
||||
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
|
||||
run: |
|
||||
mkdir -p /data/tmp/frogpilot_tinygrad
|
||||
cd /data/tmp/frogpilot_tinygrad
|
||||
git clone --depth 1 --branch Tinygrad https://oauth2:${GITLAB_TOKEN}@gitlab.com/FrogAi/FrogPilot-Resources.git
|
||||
|
||||
- name: Create Tinygrad Archive
|
||||
run: |
|
||||
cd /data/openpilot
|
||||
|
||||
ARCHIVE_NAME="Tinygrad_${{ steps.get_version.outputs.version }}.tar.gz"
|
||||
|
||||
tar -czf "/data/tmp/frogpilot_tinygrad/FrogPilot-Resources/$ARCHIVE_NAME" \
|
||||
--exclude="*.a" \
|
||||
--exclude="*.cc" \
|
||||
--exclude="*.h" \
|
||||
--exclude="*.o" \
|
||||
--exclude="*.onnx" \
|
||||
--exclude="*.pkl" \
|
||||
--exclude="*__pycache__*" \
|
||||
--exclude="*tests*" \
|
||||
frogpilot/tinygrad_modeld tinygrad tinygrad_repo
|
||||
|
||||
- name: Push updated Tinygrad
|
||||
run: |
|
||||
cd /data/tmp/frogpilot_tinygrad/FrogPilot-Resources
|
||||
|
||||
git config user.name "James"
|
||||
git config user.email "91348155+FrogAi@users.noreply.github.com"
|
||||
|
||||
git add Tinygrad_*.tar.gz
|
||||
git commit -m "Updated Tinygrad: ${{ steps.get_version.outputs.version }}"
|
||||
git push origin Tinygrad
|
||||
|
||||
- name: Cleanup temporary files
|
||||
run: |
|
||||
rm -rf /data/tmp/frogpilot_tinygrad
|
||||
Reference in New Issue
Block a user