Update cron.yml
This commit is contained in:
parent
0e10fadcb6
commit
5fdfb8848b
12 changed files with 114 additions and 99 deletions
10
.github/workflows/cron.yml
vendored
10
.github/workflows/cron.yml
vendored
|
|
@ -32,8 +32,8 @@ jobs:
|
||||||
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }}
|
||||||
IDF_BRANCH: ${{ matrix.idf_branch }}
|
IDF_BRANCH: ${{ matrix.idf_branch }}
|
||||||
run: bash ./tools/cron.sh
|
run: bash ./tools/cron.sh
|
||||||
# - name: Upload archive
|
- name: Upload archive
|
||||||
# uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
# with:
|
with:
|
||||||
# name: arduino-libs
|
name: artifacts
|
||||||
# path: dist
|
path: dist
|
||||||
|
|
|
||||||
2
.github/workflows/push.yml
vendored
2
.github/workflows/push.yml
vendored
|
|
@ -23,5 +23,5 @@ jobs:
|
||||||
- name: Upload archive
|
- name: Upload archive
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: arduino-libs
|
name: artifacts
|
||||||
path: dist
|
path: dist
|
||||||
|
|
|
||||||
6
.github/workflows/repository_dispatch.yml
vendored
6
.github/workflows/repository_dispatch.yml
vendored
|
|
@ -6,7 +6,6 @@ jobs:
|
||||||
run:
|
run:
|
||||||
name: Dispatch Event
|
name: Dispatch Event
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|
@ -17,3 +16,8 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }}
|
||||||
run: bash ./tools/repository_dispatch.sh
|
run: bash ./tools/repository_dispatch.sh
|
||||||
|
- name: Upload archive
|
||||||
|
uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: artifacts
|
||||||
|
path: dist
|
||||||
|
|
|
||||||
2
build.sh
2
build.sh
|
|
@ -35,6 +35,8 @@ if ! [ -x "$(command -v stat)" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
mkdir -p dist
|
||||||
|
|
||||||
# update components from git
|
# update components from git
|
||||||
./tools/update-components.sh
|
./tools/update-components.sh
|
||||||
if [ $? -ne 0 ]; then exit 1; fi
|
if [ $? -ne 0 ]; then exit 1; fi
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
IDF_COMMIT=$(git -C $IDF_PATH rev-parse --short HEAD)
|
IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD)
|
||||||
IDF_BRANCH=$(git -C $IDF_PATH symbolic-ref --short HEAD)
|
IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD)
|
||||||
|
|
||||||
idf_version_string=${IDF_BRANCH//\//_}"-$IDF_COMMIT"
|
idf_version_string=${IDF_BRANCH//\//_}"-$IDF_COMMIT"
|
||||||
archive_path="dist/arduino-esp32-libs-$idf_version_string.tar.gz"
|
archive_path="dist/arduino-esp32-libs-$idf_version_string.tar.gz"
|
||||||
|
build_archive_path="dist/arduino-esp32-build-$idf_version_string.tar.gz"
|
||||||
|
|
||||||
mkdir -p dist && \
|
mkdir -p dist && rm -rf "$archive_path" "$build_archive_path"
|
||||||
rm -rf $archive_path && \
|
if [ -d "out" ]; then
|
||||||
cd out && \
|
cd out && tar zcf "../$archive_path" * && cd ..
|
||||||
tar zcf ../$archive_path * \
|
fi
|
||||||
&& cd ..
|
if [ -d "build" ]; then
|
||||||
|
cd build && tar zcf "../$build_archive_path" * && cd ..
|
||||||
|
fi
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ if [ -z $IDF_BRANCH ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Owner of the target ESP32 Arduino repository
|
# Owner of the target ESP32 Arduino repository
|
||||||
AR_USER="me-no-dev"
|
AR_USER="espressif"
|
||||||
|
|
||||||
# The full name of the repository
|
# The full name of the repository
|
||||||
AR_REPO="$AR_USER/arduino-esp32"
|
AR_REPO="$AR_USER/arduino-esp32"
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ ! $GITHUB_EVENT_NAME == "schedule" ]; then
|
if [ ! "$GITHUB_EVENT_NAME" == "schedule" ]; then
|
||||||
echo "Wrong event '$GITHUB_EVENT_NAME'!"
|
echo "Wrong event '$GITHUB_EVENT_NAME'!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Event: $GITHUB_EVENT_NAME, Repo: $GITHUB_REPOSITORY, Path: $GITHUB_WORKSPACE, Ref: $GITHUB_REF"
|
|
||||||
|
|
||||||
git checkout "$IDF_BRANCH" #local branches should match what the matrix wants to build
|
git checkout "$IDF_BRANCH" #local branches should match what the matrix wants to build
|
||||||
|
|
||||||
source ./build.sh
|
source ./build.sh
|
||||||
|
|
||||||
bash ./tools/push-to-arduino.sh
|
bash ./tools/push-to-arduino.sh
|
||||||
#bash ./tools/archive-build.sh
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,10 @@ if ! [ -x "$(command -v $SED)" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# CLONE ESP-IDF
|
||||||
|
#
|
||||||
|
|
||||||
if [ -z "$IDF_PATH" ]; then
|
if [ -z "$IDF_PATH" ]; then
|
||||||
echo "ESP-IDF is not installed! Installing local copy"
|
echo "ESP-IDF is not installed! Installing local copy"
|
||||||
idf_was_installed="1"
|
idf_was_installed="1"
|
||||||
|
|
@ -17,12 +21,16 @@ if [ -z "$IDF_PATH" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$IDF_COMMIT" ]; then
|
if [ "$IDF_COMMIT" ]; then
|
||||||
git -C $IDF_PATH checkout $IDF_COMMIT
|
git -C "$IDF_PATH" checkout "$IDF_COMMIT"
|
||||||
commit_predefined="1"
|
commit_predefined="1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export IDF_COMMIT=$(git -C $IDF_PATH rev-parse --short HEAD)
|
export IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD)
|
||||||
export IDF_BRANCH=$(git -C $IDF_PATH symbolic-ref --short HEAD)
|
export IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD)
|
||||||
|
|
||||||
|
#
|
||||||
|
# SETUP ARDUINO DEPLOY
|
||||||
|
#
|
||||||
|
|
||||||
if [ "$GITHUB_EVENT_NAME" == "schedule" ] || [ "$GITHUB_EVENT_NAME" == "repository_dispatch" -a "$GITHUB_EVENT_ACTION" == "deploy" ]; then
|
if [ "$GITHUB_EVENT_NAME" == "schedule" ] || [ "$GITHUB_EVENT_NAME" == "repository_dispatch" -a "$GITHUB_EVENT_ACTION" == "deploy" ]; then
|
||||||
# format new branch name and pr title
|
# format new branch name and pr title
|
||||||
|
|
@ -53,6 +61,24 @@ if [ "$GITHUB_EVENT_NAME" == "schedule" ] || [ "$GITHUB_EVENT_NAME" == "reposito
|
||||||
echo "PR '$AR_NEW_PR_TITLE' Already Exists"
|
echo "PR '$AR_NEW_PR_TITLE' Already Exists"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# setup git for pushing
|
||||||
|
git config --global github.user "$GITHUB_ACTOR"
|
||||||
|
git config --global user.name "$GITHUB_ACTOR"
|
||||||
|
git config --global user.email "$GITHUB_ACTOR@github.com"
|
||||||
|
|
||||||
|
# create or checkout the branch
|
||||||
|
if [ ! $AR_HAS_BRANCH == "0" ]; then
|
||||||
|
echo "Switching to arduino branch '$AR_NEW_BRANCH_NAME'..."
|
||||||
|
git -C "$AR_COMPS/arduino" checkout $AR_NEW_BRANCH_NAME
|
||||||
|
else
|
||||||
|
echo "Creating arduino branch '$AR_NEW_BRANCH_NAME'..."
|
||||||
|
git -C "$AR_COMPS/arduino" checkout -b $AR_NEW_BRANCH_NAME
|
||||||
|
fi
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "ERROR: Checkout of branch '$AR_NEW_BRANCH_NAME' failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
export AR_NEW_BRANCH_NAME
|
export AR_NEW_BRANCH_NAME
|
||||||
export AR_NEW_COMMIT_MESSAGE
|
export AR_NEW_COMMIT_MESSAGE
|
||||||
export AR_NEW_PR_TITLE
|
export AR_NEW_PR_TITLE
|
||||||
|
|
@ -62,6 +88,10 @@ if [ "$GITHUB_EVENT_NAME" == "schedule" ] || [ "$GITHUB_EVENT_NAME" == "reposito
|
||||||
export AR_HAS_PR
|
export AR_HAS_PR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# UPDATE IDF MODULES
|
||||||
|
#
|
||||||
|
|
||||||
if [ -x $idf_was_installed ]; then
|
if [ -x $idf_was_installed ]; then
|
||||||
git -C $IDF_PATH fetch origin && git -C $IDF_PATH pull origin $IDF_BRANCH
|
git -C $IDF_PATH fetch origin && git -C $IDF_PATH pull origin $IDF_BRANCH
|
||||||
git -C $IDF_PATH submodule update --init --recursive
|
git -C $IDF_PATH submodule update --init --recursive
|
||||||
|
|
@ -70,6 +100,10 @@ else
|
||||||
cd $IDF_PATH && python -m pip install -r requirements.txt && cd "$AR_ROOT"
|
cd $IDF_PATH && python -m pip install -r requirements.txt && cd "$AR_ROOT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# INSTALL TOOLCHAIN
|
||||||
|
#
|
||||||
|
|
||||||
if ! [ -x "$(command -v $IDF_TOOLCHAIN-gcc)" ]; then
|
if ! [ -x "$(command -v $IDF_TOOLCHAIN-gcc)" ]; then
|
||||||
echo "GCC toolchain is not installed! Installing local copy"
|
echo "GCC toolchain is not installed! Installing local copy"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ cat pio_start.txt > "$AR_PLATFORMIO_PY"
|
||||||
rm pio_end.txt 1pio_start.txt 2pio_start.txt pio_start.txt
|
rm pio_end.txt 1pio_start.txt 2pio_start.txt pio_start.txt
|
||||||
|
|
||||||
# include dirs
|
# include dirs
|
||||||
AR_INC="-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DHAVE_CONFIG_H \"-I{compiler.sdk.path}/include/config\""
|
AR_INC="-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX \"-I{compiler.sdk.path}/include/config\""
|
||||||
echo " CPPPATH=[" >> "$AR_PLATFORMIO_PY" && echo " join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"include\", \"config\")," >> "$AR_PLATFORMIO_PY"
|
echo " CPPPATH=[" >> "$AR_PLATFORMIO_PY" && echo " join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"include\", \"config\")," >> "$AR_PLATFORMIO_PY"
|
||||||
while [ "$1" != "" ]; do
|
while [ "$1" != "" ]; do
|
||||||
cpath=$1
|
cpath=$1
|
||||||
|
|
|
||||||
|
|
@ -11,46 +11,13 @@ if ! [ -d "$AR_COMPS/arduino" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# # format new branch name and pr title
|
|
||||||
# if [ -x $1 ]; then #commit was not specified at build time
|
|
||||||
# AR_NEW_BRANCH_NAME="idf-$IDF_BRANCH"
|
|
||||||
# AR_NEW_COMMIT_MESSAGE="IDF $IDF_BRANCH $IDF_COMMIT"
|
|
||||||
# AR_NEW_PR_TITLE="IDF $IDF_BRANCH"
|
|
||||||
# else
|
|
||||||
# AR_NEW_BRANCH_NAME="idf-$IDF_COMMIT"
|
|
||||||
# AR_NEW_COMMIT_MESSAGE="IDF $IDF_COMMIT"
|
|
||||||
# AR_NEW_PR_TITLE="$AR_NEW_COMMIT_MESSAGE"
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# AR_HAS_COMMIT=`git_commit_exists "$AR_COMPS/arduino" "$AR_NEW_COMMIT_MESSAGE"`
|
|
||||||
# AR_HAS_BRANCH=`git_branch_exists "$AR_COMPS/arduino" "$AR_NEW_BRANCH_NAME"`
|
|
||||||
# AR_HAS_PR=`git_pr_exists "$AR_NEW_BRANCH_NAME"`
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# CREATE/UPDATE BRANCH
|
# UPDATE FILES
|
||||||
#
|
#
|
||||||
|
|
||||||
if [ $AR_HAS_COMMIT == "0" ]; then
|
if [ $AR_HAS_COMMIT == "0" ]; then
|
||||||
cd $AR_COMPS/arduino
|
cd $AR_COMPS/arduino
|
||||||
|
|
||||||
# setup git for pushing
|
|
||||||
git config --global github.user "$GITHUB_ACTOR"
|
|
||||||
git config --global user.name "$GITHUB_ACTOR"
|
|
||||||
git config --global user.email "$GITHUB_ACTOR@github.com"
|
|
||||||
|
|
||||||
# create or checkout the branch
|
|
||||||
if [ ! $AR_HAS_BRANCH == "0" ]; then
|
|
||||||
echo "Switching to branch '$AR_NEW_BRANCH_NAME'..."
|
|
||||||
git checkout $AR_NEW_BRANCH_NAME
|
|
||||||
else
|
|
||||||
echo "Creating branch '$AR_NEW_BRANCH_NAME'..."
|
|
||||||
git checkout -b $AR_NEW_BRANCH_NAME
|
|
||||||
fi
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "ERROR: Checkour of branch '$AR_NEW_BRANCH_NAME' failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# make changes to the files
|
# make changes to the files
|
||||||
echo "Patching files in branch '$AR_NEW_BRANCH_NAME'..."
|
echo "Patching files in branch '$AR_NEW_BRANCH_NAME'..."
|
||||||
rm -rf $AR_COMPS/arduino/tools/sdk
|
rm -rf $AR_COMPS/arduino/tools/sdk
|
||||||
|
|
|
||||||
|
|
@ -1,41 +1,41 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ ! $GITHUB_EVENT_NAME == "repository_dispatch" ]; then
|
if [ ! "$GITHUB_EVENT_NAME" == "repository_dispatch" ]; then
|
||||||
echo "Wrong event '$GITHUB_EVENT_NAME'!"
|
echo "Wrong event '$GITHUB_EVENT_NAME'!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#echo "Event: $GITHUB_EVENT_NAME, Repo: $GITHUB_REPOSITORY, Path: $GITHUB_WORKSPACE, Ref: $GITHUB_REF"
|
EVENT_JSON=`cat "$GITHUB_EVENT_PATH"`
|
||||||
|
action=`echo "$EVENT_JSON" | jq -r '.action'`
|
||||||
|
payload=`echo "$EVENT_JSON" | jq -r '.client_payload'`
|
||||||
|
branch=`echo "$payload" | jq -r '.branch'`
|
||||||
|
commit=`echo "$payload" | jq -r '.commit'`
|
||||||
|
builder=`echo "$payload" | jq -r '.builder'`
|
||||||
|
|
||||||
EVENT_JSON=`cat $GITHUB_EVENT_PATH`
|
echo "Action: $action, Branch: $branch, Commit: $commit, Builder: $builder"
|
||||||
action=`echo $EVENT_JSON | jq -r '.action'`
|
|
||||||
payload=`echo $EVENT_JSON | jq -r '.client_payload'`
|
|
||||||
branch=`echo $payload | jq -r '.branch'`
|
|
||||||
commit=`echo $payload | jq -r '.commit'`
|
|
||||||
|
|
||||||
echo "Action: $action, Branch: $branch, Commit: $commit"
|
if [ ! "$action" == "deploy" ] && [ ! "$action" == "build" ]; then
|
||||||
|
|
||||||
if [ ! $action == "deploy" ] && [ ! $action == "build" ]; then
|
|
||||||
echo "Bad Action $action"
|
echo "Bad Action $action"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export GITHUB_EVENT_ACTION="$action"
|
export GITHUB_EVENT_ACTION="$action"
|
||||||
|
|
||||||
if [ ! $commit == "" ] && [ ! $commit == "null" ]; then
|
if [ ! "$commit" == "" ] && [ ! "$commit" == "null" ]; then
|
||||||
export IDF_COMMIT="$commit"
|
export IDF_COMMIT="$commit"
|
||||||
else
|
else
|
||||||
commit=""
|
commit=""
|
||||||
if [ ! $branch == "" ] && [ ! $branch == "null" ]; then
|
if [ ! "$branch" == "" ] && [ ! "$branch" == "null" ]; then
|
||||||
export IDF_BRANCH="$branch"
|
export IDF_BRANCH="$branch"
|
||||||
git checkout "$IDF_BRANCH" #local branches should match what the matrix wants to build
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! "$builder" == "" ] && [ ! "$builder" == "null" ]; then
|
||||||
|
git checkout "$builder"
|
||||||
|
fi
|
||||||
|
|
||||||
source ./build.sh
|
source ./build.sh
|
||||||
|
|
||||||
#bash ./tools/archive-build.sh
|
if [ "$action" == "deploy" ]; then
|
||||||
|
bash ./tools/push-to-arduino.sh
|
||||||
if [ $action == "deploy" ]; then
|
|
||||||
bash ./tools/push-to-arduino.sh $commit
|
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -2,29 +2,39 @@
|
||||||
|
|
||||||
source ./tools/config.sh
|
source ./tools/config.sh
|
||||||
|
|
||||||
cd "$AR_COMPS"
|
#
|
||||||
|
# CLONE/UPDATE ARDUINO
|
||||||
|
#
|
||||||
|
|
||||||
if [ ! -d "arduino" ]; then
|
if [ ! -d "$AR_COMPS/arduino" ]; then
|
||||||
git clone $AR_REPO_URL arduino
|
git clone $AR_REPO_URL "$AR_COMPS/arduino"
|
||||||
|
else
|
||||||
|
git -C "$AR_COMPS/arduino" fetch origin && \
|
||||||
|
git -C "$AR_COMPS/arduino" pull origin master
|
||||||
fi
|
fi
|
||||||
|
if [ $? -ne 0 ]; then exit 1; fi
|
||||||
|
git -C "$AR_COMPS/arduino" submodule update --init --recursive
|
||||||
|
|
||||||
if [ ! -d "esp32-camera" ]; then
|
#
|
||||||
git clone --depth 1 $CAMERA_REPO_URL
|
# CLONE/UPDATE ESP32-CAMERA
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ ! -d "$AR_COMPS/esp32-camera" ]; then
|
||||||
|
git clone $CAMERA_REPO_URL "$AR_COMPS/esp32-camera"
|
||||||
|
else
|
||||||
|
git -C "$AR_COMPS/esp32-camera" fetch origin && \
|
||||||
|
git -C "$AR_COMPS/esp32-camera" pull origin master
|
||||||
fi
|
fi
|
||||||
|
if [ $? -ne 0 ]; then exit 1; fi
|
||||||
|
|
||||||
if [ ! -d "esp-face" ]; then
|
#
|
||||||
git clone --depth 1 $FACE_REPO_URL
|
# CLONE/UPDATE ESP-FACE
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ ! -d "$AR_COMPS/esp-face" ]; then
|
||||||
|
git clone $FACE_REPO_URL "$AR_COMPS/esp-face"
|
||||||
|
else
|
||||||
|
git -C "$AR_COMPS/esp-face" fetch origin && \
|
||||||
|
git -C "$AR_COMPS/esp-face" pull origin master
|
||||||
fi
|
fi
|
||||||
|
if [ $? -ne 0 ]; then exit 1; fi
|
||||||
cd "$AR_ROOT"
|
|
||||||
|
|
||||||
for component in `ls components`; do
|
|
||||||
cd "$AR_COMPS/$component"
|
|
||||||
if [ -d ".git" ]; then
|
|
||||||
git fetch origin && git pull origin master
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
cd "$AR_COMPS/arduino"
|
|
||||||
git submodule update --init --recursive
|
|
||||||
cd "$AR_ROOT"
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue