Update cron.yml

This commit is contained in:
Me No Dev 2019-09-27 15:51:01 +03:00 committed by me-no-dev
parent 0e10fadcb6
commit 5fdfb8848b
12 changed files with 114 additions and 99 deletions

View file

@ -32,8 +32,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }}
IDF_BRANCH: ${{ matrix.idf_branch }}
run: bash ./tools/cron.sh
# - name: Upload archive
# uses: actions/upload-artifact@v1
# with:
# name: arduino-libs
# path: dist
- name: Upload archive
uses: actions/upload-artifact@v1
with:
name: artifacts
path: dist

View file

@ -23,5 +23,5 @@ jobs:
- name: Upload archive
uses: actions/upload-artifact@v1
with:
name: arduino-libs
name: artifacts
path: dist

View file

@ -6,7 +6,6 @@ jobs:
run:
name: Dispatch Event
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install dependencies
@ -17,3 +16,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }}
run: bash ./tools/repository_dispatch.sh
- name: Upload archive
uses: actions/upload-artifact@v1
with:
name: artifacts
path: dist

View file

@ -35,6 +35,8 @@ if ! [ -x "$(command -v stat)" ]; then
exit 1
fi
mkdir -p dist
# update components from git
./tools/update-components.sh
if [ $? -ne 0 ]; then exit 1; fi

View file

@ -1,13 +1,16 @@
#!/bin/bash
IDF_COMMIT=$(git -C $IDF_PATH rev-parse --short HEAD)
IDF_BRANCH=$(git -C $IDF_PATH symbolic-ref --short HEAD)
IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD)
IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD)
idf_version_string=${IDF_BRANCH//\//_}"-$IDF_COMMIT"
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 && \
rm -rf $archive_path && \
cd out && \
tar zcf ../$archive_path * \
&& cd ..
mkdir -p dist && rm -rf "$archive_path" "$build_archive_path"
if [ -d "out" ]; then
cd out && tar zcf "../$archive_path" * && cd ..
fi
if [ -d "build" ]; then
cd build && tar zcf "../$build_archive_path" * && cd ..
fi

View file

@ -13,7 +13,7 @@ if [ -z $IDF_BRANCH ]; then
fi
# Owner of the target ESP32 Arduino repository
AR_USER="me-no-dev"
AR_USER="espressif"
# The full name of the repository
AR_REPO="$AR_USER/arduino-esp32"

View file

@ -1,15 +1,10 @@
#!/bin/bash
if [ ! $GITHUB_EVENT_NAME == "schedule" ]; then
if [ ! "$GITHUB_EVENT_NAME" == "schedule" ]; then
echo "Wrong event '$GITHUB_EVENT_NAME'!"
exit 1
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
source ./build.sh
bash ./tools/push-to-arduino.sh
#bash ./tools/archive-build.sh

View file

@ -7,6 +7,10 @@ if ! [ -x "$(command -v $SED)" ]; then
exit 1
fi
#
# CLONE ESP-IDF
#
if [ -z "$IDF_PATH" ]; then
echo "ESP-IDF is not installed! Installing local copy"
idf_was_installed="1"
@ -17,12 +21,16 @@ if [ -z "$IDF_PATH" ]; then
fi
if [ "$IDF_COMMIT" ]; then
git -C $IDF_PATH checkout $IDF_COMMIT
git -C "$IDF_PATH" checkout "$IDF_COMMIT"
commit_predefined="1"
fi
export IDF_COMMIT=$(git -C $IDF_PATH rev-parse --short HEAD)
export IDF_BRANCH=$(git -C $IDF_PATH symbolic-ref --short HEAD)
export IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --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
# 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"
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_COMMIT_MESSAGE
export AR_NEW_PR_TITLE
@ -62,6 +88,10 @@ if [ "$GITHUB_EVENT_NAME" == "schedule" ] || [ "$GITHUB_EVENT_NAME" == "reposito
export AR_HAS_PR
fi
#
# UPDATE IDF MODULES
#
if [ -x $idf_was_installed ]; then
git -C $IDF_PATH fetch origin && git -C $IDF_PATH pull origin $IDF_BRANCH
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"
fi
#
# INSTALL TOOLCHAIN
#
if ! [ -x "$(command -v $IDF_TOOLCHAIN-gcc)" ]; then
echo "GCC toolchain is not installed! Installing local copy"

View file

@ -16,7 +16,7 @@ cat pio_start.txt > "$AR_PLATFORMIO_PY"
rm pio_end.txt 1pio_start.txt 2pio_start.txt pio_start.txt
# 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"
while [ "$1" != "" ]; do
cpath=$1

View file

@ -11,46 +11,13 @@ if ! [ -d "$AR_COMPS/arduino" ]; then
exit 1
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
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
echo "Patching files in branch '$AR_NEW_BRANCH_NAME'..."
rm -rf $AR_COMPS/arduino/tools/sdk

View file

@ -1,41 +1,41 @@
#!/bin/bash
if [ ! $GITHUB_EVENT_NAME == "repository_dispatch" ]; then
if [ ! "$GITHUB_EVENT_NAME" == "repository_dispatch" ]; then
echo "Wrong event '$GITHUB_EVENT_NAME'!"
exit 1
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`
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, Builder: $builder"
echo "Action: $action, Branch: $branch, Commit: $commit"
if [ ! $action == "deploy" ] && [ ! $action == "build" ]; then
if [ ! "$action" == "deploy" ] && [ ! "$action" == "build" ]; then
echo "Bad Action $action"
exit 1
fi
export GITHUB_EVENT_ACTION="$action"
if [ ! $commit == "" ] && [ ! $commit == "null" ]; then
if [ ! "$commit" == "" ] && [ ! "$commit" == "null" ]; then
export IDF_COMMIT="$commit"
else
commit=""
if [ ! $branch == "" ] && [ ! $branch == "null" ]; then
export IDF_BRANCH="$branch"
git checkout "$IDF_BRANCH" #local branches should match what the matrix wants to build
fi
commit=""
if [ ! "$branch" == "" ] && [ ! "$branch" == "null" ]; then
export IDF_BRANCH="$branch"
fi
fi
if [ ! "$builder" == "" ] && [ ! "$builder" == "null" ]; then
git checkout "$builder"
fi
source ./build.sh
#bash ./tools/archive-build.sh
if [ $action == "deploy" ]; then
bash ./tools/push-to-arduino.sh $commit
if [ "$action" == "deploy" ]; then
bash ./tools/push-to-arduino.sh
fi

View file

@ -2,29 +2,39 @@
source ./tools/config.sh
cd "$AR_COMPS"
#
# CLONE/UPDATE ARDUINO
#
if [ ! -d "arduino" ]; then
git clone $AR_REPO_URL arduino
if [ ! -d "$AR_COMPS/arduino" ]; then
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
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
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
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"
if [ $? -ne 0 ]; then exit 1; fi