forked from espressif/arduino-esp32
.github/scripts: Fix indentation and trailing spaces. (#6157)
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
committed by
GitHub
parent
4a1cbeb69b
commit
a61609376a
50
.github/scripts/install-arduino-core-esp32.sh
vendored
50
.github/scripts/install-arduino-core-esp32.sh
vendored
@ -2,35 +2,35 @@
|
|||||||
|
|
||||||
export ARDUINO_ESP32_PATH="$ARDUINO_USR_PATH/hardware/espressif/esp32"
|
export ARDUINO_ESP32_PATH="$ARDUINO_USR_PATH/hardware/espressif/esp32"
|
||||||
if [ ! -d "$ARDUINO_ESP32_PATH" ]; then
|
if [ ! -d "$ARDUINO_ESP32_PATH" ]; then
|
||||||
echo "Installing ESP32 Arduino Core ..."
|
echo "Installing ESP32 Arduino Core ..."
|
||||||
script_init_path="$PWD"
|
script_init_path="$PWD"
|
||||||
mkdir -p "$ARDUINO_USR_PATH/hardware/espressif"
|
mkdir -p "$ARDUINO_USR_PATH/hardware/espressif"
|
||||||
cd "$ARDUINO_USR_PATH/hardware/espressif"
|
cd "$ARDUINO_USR_PATH/hardware/espressif"
|
||||||
|
|
||||||
echo "Installing Python Serial ..."
|
echo "Installing Python Serial ..."
|
||||||
pip install pyserial > /dev/null
|
pip install pyserial > /dev/null
|
||||||
|
|
||||||
if [ "$OS_IS_WINDOWS" == "1" ]; then
|
if [ "$OS_IS_WINDOWS" == "1" ]; then
|
||||||
echo "Installing Python Requests ..."
|
echo "Installing Python Requests ..."
|
||||||
pip install requests > /dev/null
|
pip install requests > /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$GITHUB_REPOSITORY" ]; then
|
if [ ! -z "$GITHUB_REPOSITORY" ]; then
|
||||||
echo "Linking Core..."
|
echo "Linking Core..."
|
||||||
ln -s $GITHUB_WORKSPACE esp32
|
ln -s $GITHUB_WORKSPACE esp32
|
||||||
else
|
else
|
||||||
echo "Cloning Core Repository..."
|
echo "Cloning Core Repository..."
|
||||||
git clone https://github.com/espressif/arduino-esp32.git esp32 > /dev/null 2>&1
|
git clone https://github.com/espressif/arduino-esp32.git esp32 > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#echo "Updating Submodules ..."
|
#echo "Updating Submodules ..."
|
||||||
cd esp32
|
cd esp32
|
||||||
#git submodule update --init --recursive > /dev/null 2>&1
|
#git submodule update --init --recursive > /dev/null 2>&1
|
||||||
|
|
||||||
echo "Installing Platform Tools ..."
|
echo "Installing Platform Tools ..."
|
||||||
cd tools && python get.py
|
cd tools && python get.py
|
||||||
cd $script_init_path
|
cd $script_init_path
|
||||||
|
|
||||||
echo "ESP32 Arduino has been installed in '$ARDUINO_ESP32_PATH'"
|
echo "ESP32 Arduino has been installed in '$ARDUINO_ESP32_PATH'"
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
246
.github/scripts/install-arduino-ide.sh
vendored
246
.github/scripts/install-arduino-ide.sh
vendored
@ -6,31 +6,31 @@
|
|||||||
|
|
||||||
OSBITS=`arch`
|
OSBITS=`arch`
|
||||||
if [[ "$OSTYPE" == "linux"* ]]; then
|
if [[ "$OSTYPE" == "linux"* ]]; then
|
||||||
export OS_IS_LINUX="1"
|
export OS_IS_LINUX="1"
|
||||||
ARCHIVE_FORMAT="tar.xz"
|
ARCHIVE_FORMAT="tar.xz"
|
||||||
if [[ "$OSBITS" == "i686" ]]; then
|
if [[ "$OSBITS" == "i686" ]]; then
|
||||||
OS_NAME="linux32"
|
OS_NAME="linux32"
|
||||||
elif [[ "$OSBITS" == "x86_64" ]]; then
|
elif [[ "$OSBITS" == "x86_64" ]]; then
|
||||||
OS_NAME="linux64"
|
OS_NAME="linux64"
|
||||||
elif [[ "$OSBITS" == "armv7l" || "$OSBITS" == "aarch64" ]]; then
|
elif [[ "$OSBITS" == "armv7l" || "$OSBITS" == "aarch64" ]]; then
|
||||||
OS_NAME="linuxarm"
|
OS_NAME="linuxarm"
|
||||||
else
|
else
|
||||||
OS_NAME="$OSTYPE-$OSBITS"
|
OS_NAME="$OSTYPE-$OSBITS"
|
||||||
echo "Unknown OS '$OS_NAME'"
|
echo "Unknown OS '$OS_NAME'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
export OS_IS_MACOS="1"
|
export OS_IS_MACOS="1"
|
||||||
ARCHIVE_FORMAT="zip"
|
ARCHIVE_FORMAT="zip"
|
||||||
OS_NAME="macosx"
|
OS_NAME="macosx"
|
||||||
elif [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then
|
elif [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then
|
||||||
export OS_IS_WINDOWS="1"
|
export OS_IS_WINDOWS="1"
|
||||||
ARCHIVE_FORMAT="zip"
|
ARCHIVE_FORMAT="zip"
|
||||||
OS_NAME="windows"
|
OS_NAME="windows"
|
||||||
else
|
else
|
||||||
OS_NAME="$OSTYPE-$OSBITS"
|
OS_NAME="$OSTYPE-$OSBITS"
|
||||||
echo "Unknown OS '$OS_NAME'"
|
echo "Unknown OS '$OS_NAME'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
export OS_NAME
|
export OS_NAME
|
||||||
|
|
||||||
@ -38,14 +38,14 @@ ARDUINO_BUILD_DIR="$HOME/.arduino/build.tmp"
|
|||||||
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
|
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
|
||||||
|
|
||||||
if [ "$OS_IS_MACOS" == "1" ]; then
|
if [ "$OS_IS_MACOS" == "1" ]; then
|
||||||
export ARDUINO_IDE_PATH="/Applications/Arduino.app/Contents/Java"
|
export ARDUINO_IDE_PATH="/Applications/Arduino.app/Contents/Java"
|
||||||
export ARDUINO_USR_PATH="$HOME/Documents/Arduino"
|
export ARDUINO_USR_PATH="$HOME/Documents/Arduino"
|
||||||
elif [ "$OS_IS_WINDOWS" == "1" ]; then
|
elif [ "$OS_IS_WINDOWS" == "1" ]; then
|
||||||
export ARDUINO_IDE_PATH="$HOME/arduino_ide"
|
export ARDUINO_IDE_PATH="$HOME/arduino_ide"
|
||||||
export ARDUINO_USR_PATH="$HOME/Documents/Arduino"
|
export ARDUINO_USR_PATH="$HOME/Documents/Arduino"
|
||||||
else
|
else
|
||||||
export ARDUINO_IDE_PATH="$HOME/arduino_ide"
|
export ARDUINO_IDE_PATH="$HOME/arduino_ide"
|
||||||
export ARDUINO_USR_PATH="$HOME/Arduino"
|
export ARDUINO_USR_PATH="$HOME/Arduino"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Updated as of Nov 3rd 2020
|
# Updated as of Nov 3rd 2020
|
||||||
@ -55,76 +55,75 @@ ARDUINO_IDE_URL="https://github.com/espressif/arduino-esp32/releases/download/1.
|
|||||||
#ARDUINO_IDE_URL="https://www.arduino.cc/download.php?f=/arduino-nightly-"
|
#ARDUINO_IDE_URL="https://www.arduino.cc/download.php?f=/arduino-nightly-"
|
||||||
|
|
||||||
if [ ! -d "$ARDUINO_IDE_PATH" ]; then
|
if [ ! -d "$ARDUINO_IDE_PATH" ]; then
|
||||||
echo "Installing Arduino IDE on $OS_NAME ..."
|
echo "Installing Arduino IDE on $OS_NAME ..."
|
||||||
echo "Downloading '$ARDUINO_IDE_URL$OS_NAME.$ARCHIVE_FORMAT' to 'arduino.$ARCHIVE_FORMAT' ..."
|
echo "Downloading '$ARDUINO_IDE_URL$OS_NAME.$ARCHIVE_FORMAT' to 'arduino.$ARCHIVE_FORMAT' ..."
|
||||||
if [ "$OS_IS_LINUX" == "1" ]; then
|
if [ "$OS_IS_LINUX" == "1" ]; then
|
||||||
wget -O "arduino.$ARCHIVE_FORMAT" "$ARDUINO_IDE_URL$OS_NAME.$ARCHIVE_FORMAT" > /dev/null 2>&1
|
wget -O "arduino.$ARCHIVE_FORMAT" "$ARDUINO_IDE_URL$OS_NAME.$ARCHIVE_FORMAT" > /dev/null 2>&1
|
||||||
echo "Extracting 'arduino.$ARCHIVE_FORMAT' ..."
|
echo "Extracting 'arduino.$ARCHIVE_FORMAT' ..."
|
||||||
tar xf "arduino.$ARCHIVE_FORMAT" > /dev/null
|
tar xf "arduino.$ARCHIVE_FORMAT" > /dev/null
|
||||||
mv arduino-nightly "$ARDUINO_IDE_PATH"
|
mv arduino-nightly "$ARDUINO_IDE_PATH"
|
||||||
else
|
else
|
||||||
curl -o "arduino.$ARCHIVE_FORMAT" -L "$ARDUINO_IDE_URL$OS_NAME.$ARCHIVE_FORMAT" > /dev/null 2>&1
|
curl -o "arduino.$ARCHIVE_FORMAT" -L "$ARDUINO_IDE_URL$OS_NAME.$ARCHIVE_FORMAT" > /dev/null 2>&1
|
||||||
echo "Extracting 'arduino.$ARCHIVE_FORMAT' ..."
|
echo "Extracting 'arduino.$ARCHIVE_FORMAT' ..."
|
||||||
unzip "arduino.$ARCHIVE_FORMAT" > /dev/null
|
unzip "arduino.$ARCHIVE_FORMAT" > /dev/null
|
||||||
if [ "$OS_IS_MACOS" == "1" ]; then
|
if [ "$OS_IS_MACOS" == "1" ]; then
|
||||||
mv "Arduino.app" "/Applications/Arduino.app"
|
mv "Arduino.app" "/Applications/Arduino.app"
|
||||||
else
|
else
|
||||||
mv arduino-nightly "$ARDUINO_IDE_PATH"
|
mv arduino-nightly "$ARDUINO_IDE_PATH"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
rm -rf "arduino.$ARCHIVE_FORMAT"
|
rm -rf "arduino.$ARCHIVE_FORMAT"
|
||||||
|
|
||||||
mkdir -p "$ARDUINO_USR_PATH/libraries"
|
mkdir -p "$ARDUINO_USR_PATH/libraries"
|
||||||
mkdir -p "$ARDUINO_USR_PATH/hardware"
|
mkdir -p "$ARDUINO_USR_PATH/hardware"
|
||||||
|
|
||||||
echo "Arduino IDE Installed in '$ARDUINO_IDE_PATH'"
|
echo "Arduino IDE Installed in '$ARDUINO_IDE_PATH'"
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function build_sketch(){ # build_sketch <fqbn> <path-to-ino> [extra-options]
|
function build_sketch(){ # build_sketch <fqbn> <path-to-ino> [extra-options]
|
||||||
if [ "$#" -lt 2 ]; then
|
if [ "$#" -lt 2 ]; then
|
||||||
echo "ERROR: Illegal number of parameters"
|
echo "ERROR: Illegal number of parameters"
|
||||||
echo "USAGE: build_sketch <fqbn> <path-to-ino> [extra-options]"
|
echo "USAGE: build_sketch <fqbn> <path-to-ino> [extra-options]"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local fqbn="$1"
|
local fqbn="$1"
|
||||||
local sketch="$2"
|
local sketch="$2"
|
||||||
local xtra_opts="$3"
|
local xtra_opts="$3"
|
||||||
local win_opts=""
|
local win_opts=""
|
||||||
if [ "$OS_IS_WINDOWS" == "1" ]; then
|
if [ "$OS_IS_WINDOWS" == "1" ]; then
|
||||||
local ctags_version=`ls "$ARDUINO_IDE_PATH/tools-builder/ctags/"`
|
local ctags_version=`ls "$ARDUINO_IDE_PATH/tools-builder/ctags/"`
|
||||||
local preprocessor_version=`ls "$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/"`
|
local preprocessor_version=`ls "$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/"`
|
||||||
win_opts="-prefs=runtime.tools.ctags.path=$ARDUINO_IDE_PATH/tools-builder/ctags/$ctags_version -prefs=runtime.tools.arduino-preprocessor.path=$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/$preprocessor_version"
|
win_opts="-prefs=runtime.tools.ctags.path=$ARDUINO_IDE_PATH/tools-builder/ctags/$ctags_version -prefs=runtime.tools.arduino-preprocessor.path=$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/$preprocessor_version"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#echo ""
|
#echo ""
|
||||||
#echo "Compiling '"$(basename "$sketch")"' ..."
|
#echo "Compiling '"$(basename "$sketch")"' ..."
|
||||||
mkdir -p "$ARDUINO_BUILD_DIR"
|
mkdir -p "$ARDUINO_BUILD_DIR"
|
||||||
mkdir -p "$ARDUINO_CACHE_DIR"
|
mkdir -p "$ARDUINO_CACHE_DIR"
|
||||||
$ARDUINO_IDE_PATH/arduino-builder -compile -logger=human -core-api-version=10810 \
|
$ARDUINO_IDE_PATH/arduino-builder -compile -logger=human -core-api-version=10810 \
|
||||||
-fqbn=$fqbn \
|
-fqbn=$fqbn \
|
||||||
-warnings="all" \
|
-warnings="all" \
|
||||||
-tools "$ARDUINO_IDE_PATH/tools-builder" \
|
-tools "$ARDUINO_IDE_PATH/tools-builder" \
|
||||||
-tools "$ARDUINO_IDE_PATH/tools" \
|
-tools "$ARDUINO_IDE_PATH/tools" \
|
||||||
-built-in-libraries "$ARDUINO_IDE_PATH/libraries" \
|
-built-in-libraries "$ARDUINO_IDE_PATH/libraries" \
|
||||||
-hardware "$ARDUINO_IDE_PATH/hardware" \
|
-hardware "$ARDUINO_IDE_PATH/hardware" \
|
||||||
-hardware "$ARDUINO_USR_PATH/hardware" \
|
-hardware "$ARDUINO_USR_PATH/hardware" \
|
||||||
-libraries "$ARDUINO_USR_PATH/libraries" \
|
-libraries "$ARDUINO_USR_PATH/libraries" \
|
||||||
-build-cache "$ARDUINO_CACHE_DIR" \
|
-build-cache "$ARDUINO_CACHE_DIR" \
|
||||||
-build-path "$ARDUINO_BUILD_DIR" \
|
-build-path "$ARDUINO_BUILD_DIR" \
|
||||||
$win_opts $xtra_opts "$sketch"
|
$win_opts $xtra_opts "$sketch"
|
||||||
}
|
}
|
||||||
|
|
||||||
function count_sketches() # count_sketches <examples-path> <target-mcu>
|
function count_sketches(){ # count_sketches <examples-path> <target-mcu>
|
||||||
{
|
local examples="$1"
|
||||||
local examples="$1"
|
local target="$2"
|
||||||
local target="$2"
|
|
||||||
rm -rf sketches.txt
|
rm -rf sketches.txt
|
||||||
if [ ! -d "$examples" ]; then
|
if [ ! -d "$examples" ]; then
|
||||||
touch sketches.txt
|
touch sketches.txt
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
local sketches=$(find $examples -name *.ino)
|
local sketches=$(find $examples -name *.ino)
|
||||||
local sketchnum=0
|
local sketchnum=0
|
||||||
for sketch in $sketches; do
|
for sketch in $sketches; do
|
||||||
@ -136,73 +135,72 @@ function count_sketches() # count_sketches <examples-path> <target-mcu>
|
|||||||
elif [[ -f "$sketchdir/.skip.$target" ]]; then
|
elif [[ -f "$sketchdir/.skip.$target" ]]; then
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
echo $sketch >> sketches.txt
|
echo $sketch >> sketches.txt
|
||||||
sketchnum=$(($sketchnum + 1))
|
sketchnum=$(($sketchnum + 1))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
return $sketchnum
|
return $sketchnum
|
||||||
}
|
}
|
||||||
|
|
||||||
function build_sketches() # build_sketches <fqbn> <target-mcu> <examples-path> <chunk> <total-chunks> [extra-options]
|
function build_sketches(){ # build_sketches <fqbn> <target-mcu> <examples-path> <chunk> <total-chunks> [extra-options]
|
||||||
{
|
|
||||||
local fqbn=$1
|
local fqbn=$1
|
||||||
local target="$2"
|
local target="$2"
|
||||||
local examples=$3
|
local examples=$3
|
||||||
local chunk_idex=$4
|
local chunk_idex=$4
|
||||||
local chunks_num=$5
|
local chunks_num=$5
|
||||||
local xtra_opts=$6
|
local xtra_opts=$6
|
||||||
|
|
||||||
if [ "$#" -lt 3 ]; then
|
if [ "$#" -lt 3 ]; then
|
||||||
echo "ERROR: Illegal number of parameters"
|
echo "ERROR: Illegal number of parameters"
|
||||||
echo "USAGE: build_sketches <fqbn> <target-mcu <examples-path> [<chunk> <total-chunks>] [extra-options]"
|
echo "USAGE: build_sketches <fqbn> <target-mcu <examples-path> [<chunk> <total-chunks>] [extra-options]"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$#" -lt 5 ]; then
|
if [ "$#" -lt 5 ]; then
|
||||||
chunk_idex="0"
|
chunk_idex="0"
|
||||||
chunks_num="1"
|
chunks_num="1"
|
||||||
xtra_opts=$4
|
xtra_opts=$4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$chunks_num" -le 0 ]; then
|
if [ "$chunks_num" -le 0 ]; then
|
||||||
echo "ERROR: Chunks count must be positive number"
|
echo "ERROR: Chunks count must be positive number"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if [ "$chunk_idex" -ge "$chunks_num" ] && [ "$chunks_num" -ge 2 ]; then
|
if [ "$chunk_idex" -ge "$chunks_num" ] && [ "$chunks_num" -ge 2 ]; then
|
||||||
echo "ERROR: Chunk index must be less than chunks count"
|
echo "ERROR: Chunk index must be less than chunks count"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
count_sketches "$examples" "$target"
|
count_sketches "$examples" "$target"
|
||||||
local sketchcount=$?
|
local sketchcount=$?
|
||||||
set -e
|
set -e
|
||||||
local sketches=$(cat sketches.txt)
|
local sketches=$(cat sketches.txt)
|
||||||
rm -rf sketches.txt
|
rm -rf sketches.txt
|
||||||
|
|
||||||
local chunk_size=$(( $sketchcount / $chunks_num ))
|
local chunk_size=$(( $sketchcount / $chunks_num ))
|
||||||
local all_chunks=$(( $chunks_num * $chunk_size ))
|
local all_chunks=$(( $chunks_num * $chunk_size ))
|
||||||
if [ "$all_chunks" -lt "$sketchcount" ]; then
|
if [ "$all_chunks" -lt "$sketchcount" ]; then
|
||||||
chunk_size=$(( $chunk_size + 1 ))
|
chunk_size=$(( $chunk_size + 1 ))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local start_index=0
|
local start_index=0
|
||||||
local end_index=0
|
local end_index=0
|
||||||
if [ "$chunk_idex" -ge "$chunks_num" ]; then
|
if [ "$chunk_idex" -ge "$chunks_num" ]; then
|
||||||
start_index=$chunk_idex
|
start_index=$chunk_idex
|
||||||
end_index=$sketchcount
|
end_index=$sketchcount
|
||||||
else
|
else
|
||||||
start_index=$(( $chunk_idex * $chunk_size ))
|
start_index=$(( $chunk_idex * $chunk_size ))
|
||||||
if [ "$sketchcount" -le "$start_index" ]; then
|
if [ "$sketchcount" -le "$start_index" ]; then
|
||||||
echo "Skipping job"
|
echo "Skipping job"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
end_index=$(( $(( $chunk_idex + 1 )) * $chunk_size ))
|
end_index=$(( $(( $chunk_idex + 1 )) * $chunk_size ))
|
||||||
if [ "$end_index" -gt "$sketchcount" ]; then
|
if [ "$end_index" -gt "$sketchcount" ]; then
|
||||||
end_index=$sketchcount
|
end_index=$sketchcount
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local start_num=$(( $start_index + 1 ))
|
local start_num=$(( $start_index + 1 ))
|
||||||
echo "Found $sketchcount Sketches for target '$target'";
|
echo "Found $sketchcount Sketches for target '$target'";
|
||||||
@ -224,7 +222,7 @@ function build_sketches() # build_sketches <fqbn> <target-mcu> <examples-path> <
|
|||||||
sketchnum=$(($sketchnum + 1))
|
sketchnum=$(($sketchnum + 1))
|
||||||
if [ "$sketchnum" -le "$start_index" ] \
|
if [ "$sketchnum" -le "$start_index" ] \
|
||||||
|| [ "$sketchnum" -gt "$end_index" ]; then
|
|| [ "$sketchnum" -gt "$end_index" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
echo "Building Sketch Index $(($sketchnum - 1)) - $sketchdirname"
|
echo "Building Sketch Index $(($sketchnum - 1)) - $sketchdirname"
|
||||||
|
16
.github/scripts/install-platformio-esp32.sh
vendored
16
.github/scripts/install-platformio-esp32.sh
vendored
@ -40,11 +40,11 @@ replace_script+="fp.seek(0);fp.truncate();json.dump(data, fp, indent=2);fp.close
|
|||||||
python -c "$replace_script"
|
python -c "$replace_script"
|
||||||
|
|
||||||
if [ "$GITHUB_REPOSITORY" == "espressif/arduino-esp32" ]; then
|
if [ "$GITHUB_REPOSITORY" == "espressif/arduino-esp32" ]; then
|
||||||
echo "Linking Core..."
|
echo "Linking Core..."
|
||||||
ln -s $GITHUB_WORKSPACE "$PLATFORMIO_ESP32_PATH"
|
ln -s $GITHUB_WORKSPACE "$PLATFORMIO_ESP32_PATH"
|
||||||
else
|
else
|
||||||
echo "Cloning Core Repository ..."
|
echo "Cloning Core Repository ..."
|
||||||
git clone --recursive https://github.com/espressif/arduino-esp32.git "$PLATFORMIO_ESP32_PATH" > /dev/null 2>&1
|
git clone --recursive https://github.com/espressif/arduino-esp32.git "$PLATFORMIO_ESP32_PATH" > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "PlatformIO for ESP32 has been installed"
|
echo "PlatformIO for ESP32 has been installed"
|
||||||
@ -66,8 +66,7 @@ function build_pio_sketch(){ # build_pio_sketch <board> <options> <path-to-ino>
|
|||||||
python -m platformio ci --board "$board" "$sketch_dir" --project-option="$options"
|
python -m platformio ci --board "$board" "$sketch_dir" --project-option="$options"
|
||||||
}
|
}
|
||||||
|
|
||||||
function count_sketches() # count_sketches <examples-path>
|
function count_sketches(){ # count_sketches <examples-path>
|
||||||
{
|
|
||||||
local examples="$1"
|
local examples="$1"
|
||||||
rm -rf sketches.txt
|
rm -rf sketches.txt
|
||||||
if [ ! -d "$examples" ]; then
|
if [ ! -d "$examples" ]; then
|
||||||
@ -82,7 +81,7 @@ function count_sketches() # count_sketches <examples-path>
|
|||||||
local sketchname=$(basename $sketch)
|
local sketchname=$(basename $sketch)
|
||||||
if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then
|
if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then
|
||||||
continue
|
continue
|
||||||
fi;
|
fi
|
||||||
if [[ -f "$sketchdir/.test.skip" ]]; then
|
if [[ -f "$sketchdir/.test.skip" ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
@ -92,8 +91,7 @@ function count_sketches() # count_sketches <examples-path>
|
|||||||
return $sketchnum
|
return $sketchnum
|
||||||
}
|
}
|
||||||
|
|
||||||
function build_pio_sketches() # build_pio_sketches <board> <options> <examples-path> <chunk> <total-chunks>
|
function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-path> <chunk> <total-chunks>
|
||||||
{
|
|
||||||
if [ "$#" -lt 3 ]; then
|
if [ "$#" -lt 3 ]; then
|
||||||
echo "ERROR: Illegal number of parameters"
|
echo "ERROR: Illegal number of parameters"
|
||||||
echo "USAGE: build_pio_sketches <board> <options> <examples-path> [<chunk> <total-chunks>]"
|
echo "USAGE: build_pio_sketches <board> <options> <examples-path> [<chunk> <total-chunks>]"
|
||||||
|
2
.github/scripts/on-pages.sh
vendored
2
.github/scripts/on-pages.sh
vendored
@ -71,7 +71,7 @@ function git_safe_upload_to_pages(){
|
|||||||
local name=$(basename "$file")
|
local name=$(basename "$file")
|
||||||
local size=`get_file_size "$file"`
|
local size=`get_file_size "$file"`
|
||||||
local upload_res=`git_upload_to_pages "$path" "$file"`
|
local upload_res=`git_upload_to_pages "$path" "$file"`
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
>&2 echo "ERROR: Failed to upload '$name' ($?)"
|
>&2 echo "ERROR: Failed to upload '$name' ($?)"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
122
.github/scripts/on-push.sh
vendored
122
.github/scripts/on-push.sh
vendored
@ -3,91 +3,91 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ -z "$GITHUB_WORKSPACE" ]; then
|
if [ -z "$GITHUB_WORKSPACE" ]; then
|
||||||
export GITHUB_WORKSPACE="$PWD"
|
export GITHUB_WORKSPACE="$PWD"
|
||||||
export GITHUB_REPOSITORY="espressif/arduino-esp32"
|
export GITHUB_REPOSITORY="espressif/arduino-esp32"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CHUNK_INDEX=$1
|
CHUNK_INDEX=$1
|
||||||
CHUNKS_CNT=$2
|
CHUNKS_CNT=$2
|
||||||
BUILD_PIO=0
|
BUILD_PIO=0
|
||||||
if [ "$#" -lt 2 ] || [ "$CHUNKS_CNT" -le 0 ]; then
|
if [ "$#" -lt 2 ] || [ "$CHUNKS_CNT" -le 0 ]; then
|
||||||
CHUNK_INDEX=0
|
CHUNK_INDEX=0
|
||||||
CHUNKS_CNT=1
|
CHUNKS_CNT=1
|
||||||
elif [ "$CHUNK_INDEX" -gt "$CHUNKS_CNT" ] && [ "$CHUNKS_CNT" -ge 2 ]; then
|
elif [ "$CHUNK_INDEX" -gt "$CHUNKS_CNT" ] && [ "$CHUNKS_CNT" -ge 2 ]; then
|
||||||
CHUNK_INDEX=$CHUNKS_CNT
|
CHUNK_INDEX=$CHUNKS_CNT
|
||||||
elif [ "$CHUNK_INDEX" -eq "$CHUNKS_CNT" ]; then
|
elif [ "$CHUNK_INDEX" -eq "$CHUNKS_CNT" ]; then
|
||||||
BUILD_PIO=1
|
BUILD_PIO=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#echo "Updating submodules ..."
|
#echo "Updating submodules ..."
|
||||||
#git -C "$GITHUB_WORKSPACE" submodule update --init --recursive > /dev/null 2>&1
|
#git -C "$GITHUB_WORKSPACE" submodule update --init --recursive > /dev/null 2>&1
|
||||||
|
|
||||||
if [ "$BUILD_PIO" -eq 0 ]; then
|
if [ "$BUILD_PIO" -eq 0 ]; then
|
||||||
# ArduinoIDE ESP32 Test
|
# ArduinoIDE ESP32 Test
|
||||||
TARGET="esp32"
|
TARGET="esp32"
|
||||||
FQBN="espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"
|
FQBN="espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"
|
||||||
source ./.github/scripts/install-arduino-ide.sh
|
source ./.github/scripts/install-arduino-ide.sh
|
||||||
source ./.github/scripts/install-arduino-core-esp32.sh
|
source ./.github/scripts/install-arduino-core-esp32.sh
|
||||||
if [ "$OS_IS_WINDOWS" == "1" ]; then
|
if [ "$OS_IS_WINDOWS" == "1" ]; then
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
|
||||||
elif [ "$OS_IS_MACOS" == "1" ]; then
|
elif [ "$OS_IS_MACOS" == "1" ]; then
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
|
||||||
else
|
else
|
||||||
# CMake Test
|
# CMake Test
|
||||||
if [ "$CHUNK_INDEX" -eq 0 ]; then
|
if [ "$CHUNK_INDEX" -eq 0 ]; then
|
||||||
bash "$ARDUINO_ESP32_PATH/.github/scripts/check-cmakelists.sh"
|
bash "$ARDUINO_ESP32_PATH/.github/scripts/check-cmakelists.sh"
|
||||||
fi
|
fi
|
||||||
build_sketches "$FQBN" "$TARGET" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
|
build_sketches "$FQBN" "$TARGET" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
|
||||||
fi
|
|
||||||
|
|
||||||
# ArduinoIDE ESP32S2 Test
|
|
||||||
TARGET="esp32s2"
|
|
||||||
FQBN="espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app"
|
|
||||||
if [ "$OS_IS_WINDOWS" == "1" ]; then
|
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
|
||||||
elif [ "$OS_IS_MACOS" == "1" ]; then
|
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
|
||||||
else
|
|
||||||
build_sketches "$FQBN" "$TARGET" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ArduinoIDE ESP32C3 Test
|
# ArduinoIDE ESP32S2 Test
|
||||||
|
TARGET="esp32s2"
|
||||||
|
FQBN="espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app"
|
||||||
|
if [ "$OS_IS_WINDOWS" == "1" ]; then
|
||||||
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
||||||
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
||||||
|
elif [ "$OS_IS_MACOS" == "1" ]; then
|
||||||
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
||||||
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
||||||
|
else
|
||||||
|
build_sketches "$FQBN" "$TARGET" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ArduinoIDE ESP32C3 Test
|
||||||
TARGET="esp32c3"
|
TARGET="esp32c3"
|
||||||
FQBN="espressif:esp32:esp32c3:PartitionScheme=huge_app"
|
FQBN="espressif:esp32:esp32c3:PartitionScheme=huge_app"
|
||||||
if [ "$OS_IS_WINDOWS" == "1" ]; then
|
if [ "$OS_IS_WINDOWS" == "1" ]; then
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
||||||
elif [ "$OS_IS_MACOS" == "1" ]; then
|
elif [ "$OS_IS_MACOS" == "1" ]; then
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
||||||
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
||||||
else
|
else
|
||||||
build_sketches "$FQBN" "$TARGET" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
|
build_sketches "$FQBN" "$TARGET" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
source ./.github/scripts/install-platformio-esp32.sh
|
source ./.github/scripts/install-platformio-esp32.sh
|
||||||
# PlatformIO ESP32 Test
|
# PlatformIO ESP32 Test
|
||||||
BOARD="esp32dev"
|
BOARD="esp32dev"
|
||||||
OPTIONS="board_build.partitions = huge_app.csv"
|
OPTIONS="board_build.partitions = huge_app.csv"
|
||||||
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
||||||
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
|
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
|
||||||
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
|
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
|
||||||
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
|
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
|
||||||
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
|
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
|
||||||
|
|
||||||
# PlatformIO ESP32 Test
|
# PlatformIO ESP32 Test
|
||||||
# OPTIONS="board_build.mcu = esp32s2"
|
# OPTIONS="board_build.mcu = esp32s2"
|
||||||
# build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
# build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
||||||
# build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
# build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
||||||
|
|
||||||
python -m platformio ci --board "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.mcu = esp32s2" --project-option="board_build.partitions = huge_app.csv"
|
python -m platformio ci --board "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.mcu = esp32s2" --project-option="board_build.partitions = huge_app.csv"
|
||||||
|
|
||||||
#build_pio_sketches "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries"
|
#build_pio_sketches "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries"
|
||||||
fi
|
fi
|
||||||
|
18
.github/scripts/on-release.sh
vendored
18
.github/scripts/on-release.sh
vendored
@ -33,7 +33,7 @@ PACKAGE_JSON_DEV="package_esp32_dev_index.json"
|
|||||||
PACKAGE_JSON_REL="package_esp32_index.json"
|
PACKAGE_JSON_REL="package_esp32_index.json"
|
||||||
|
|
||||||
echo "Event: $GITHUB_EVENT_NAME, Repo: $GITHUB_REPOSITORY, Path: $GITHUB_WORKSPACE, Ref: $GITHUB_REF"
|
echo "Event: $GITHUB_EVENT_NAME, Repo: $GITHUB_REPOSITORY, Path: $GITHUB_WORKSPACE, Ref: $GITHUB_REF"
|
||||||
echo "Action: $action, Branch: $RELEASE_BRANCH, ID: $RELEASE_ID"
|
echo "Action: $action, Branch: $RELEASE_BRANCH, ID: $RELEASE_ID"
|
||||||
echo "Tag: $RELEASE_TAG, Draft: $draft, Pre-Release: $RELEASE_PRE"
|
echo "Tag: $RELEASE_TAG, Draft: $draft, Pre-Release: $RELEASE_PRE"
|
||||||
|
|
||||||
function get_file_size(){
|
function get_file_size(){
|
||||||
@ -60,7 +60,7 @@ function git_safe_upload_asset(){
|
|||||||
local name=$(basename "$file")
|
local name=$(basename "$file")
|
||||||
local size=`get_file_size "$file"`
|
local size=`get_file_size "$file"`
|
||||||
local upload_res=`git_upload_asset "$file"`
|
local upload_res=`git_upload_asset "$file"`
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
>&2 echo "ERROR: Failed to upload '$name' ($?)"
|
>&2 echo "ERROR: Failed to upload '$name' ($?)"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@ -112,7 +112,7 @@ function git_safe_upload_to_pages(){
|
|||||||
local name=$(basename "$file")
|
local name=$(basename "$file")
|
||||||
local size=`get_file_size "$file"`
|
local size=`get_file_size "$file"`
|
||||||
local upload_res=`git_upload_to_pages "$path" "$file"`
|
local upload_res=`git_upload_to_pages "$path" "$file"`
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
>&2 echo "ERROR: Failed to upload '$name' ($?)"
|
>&2 echo "ERROR: Failed to upload '$name' ($?)"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@ -131,7 +131,7 @@ function merge_package_json(){
|
|||||||
local jsonOut=$2
|
local jsonOut=$2
|
||||||
local old_json=$OUTPUT_DIR/oldJson.json
|
local old_json=$OUTPUT_DIR/oldJson.json
|
||||||
local merged_json=$OUTPUT_DIR/mergedJson.json
|
local merged_json=$OUTPUT_DIR/mergedJson.json
|
||||||
|
|
||||||
echo "Downloading previous JSON $jsonLink ..."
|
echo "Downloading previous JSON $jsonLink ..."
|
||||||
curl -L -o "$old_json" "https://github.com/$GITHUB_REPOSITORY/releases/download/$jsonLink?access_token=$GITHUB_TOKEN" 2>/dev/null
|
curl -L -o "$old_json" "https://github.com/$GITHUB_REPOSITORY/releases/download/$jsonLink?access_token=$GITHUB_TOKEN" 2>/dev/null
|
||||||
if [ $? -ne 0 ]; then echo "ERROR: Download Failed! $?"; exit 1; fi
|
if [ $? -ne 0 ]; then echo "ERROR: Download Failed! $?"; exit 1; fi
|
||||||
@ -140,7 +140,7 @@ function merge_package_json(){
|
|||||||
set +e
|
set +e
|
||||||
stdbuf -oL python "$PACKAGE_JSON_MERGE" "$jsonOut" "$old_json" > "$merged_json"
|
stdbuf -oL python "$PACKAGE_JSON_MERGE" "$jsonOut" "$old_json" > "$merged_json"
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
set -v
|
set -v
|
||||||
if [ ! -s $merged_json ]; then
|
if [ ! -s $merged_json ]; then
|
||||||
rm -f "$merged_json"
|
rm -f "$merged_json"
|
||||||
@ -317,7 +317,7 @@ releaseNotes=""
|
|||||||
relNotesRaw=`git -C "$GITHUB_WORKSPACE" show -s --format=%b $RELEASE_TAG`
|
relNotesRaw=`git -C "$GITHUB_WORKSPACE" show -s --format=%b $RELEASE_TAG`
|
||||||
readarray -t msgArray <<<"$relNotesRaw"
|
readarray -t msgArray <<<"$relNotesRaw"
|
||||||
arrLen=${#msgArray[@]}
|
arrLen=${#msgArray[@]}
|
||||||
if [ $arrLen > 3 ] && [ "${msgArray[0]:0:3}" == "tag" ]; then
|
if [ $arrLen > 3 ] && [ "${msgArray[0]:0:3}" == "tag" ]; then
|
||||||
ind=3
|
ind=3
|
||||||
while [ $ind -lt $arrLen ]; do
|
while [ $ind -lt $arrLen ]; do
|
||||||
if [ $ind -eq 3 ]; then
|
if [ $ind -eq 3 ]; then
|
||||||
@ -327,7 +327,7 @@ if [ $arrLen > 3 ] && [ "${msgArray[0]:0:3}" == "tag" ]; then
|
|||||||
oneLine="$(echo -e "${msgArray[ind]}" | sed -e 's/^[[:space:]]*//')"
|
oneLine="$(echo -e "${msgArray[ind]}" | sed -e 's/^[[:space:]]*//')"
|
||||||
if [ ${#oneLine} -gt 0 ]; then
|
if [ ${#oneLine} -gt 0 ]; then
|
||||||
if [ "${oneLine:0:2}" == "* " ]; then oneLine=$(echo ${oneLine/\*/-}); fi
|
if [ "${oneLine:0:2}" == "* " ]; then oneLine=$(echo ${oneLine/\*/-}); fi
|
||||||
if [ "${oneLine:0:2}" != "- " ]; then releaseNotes+="- "; fi
|
if [ "${oneLine:0:2}" != "- " ]; then releaseNotes+="- "; fi
|
||||||
releaseNotes+="$oneLine"
|
releaseNotes+="$oneLine"
|
||||||
releaseNotes+=$'\r\n'
|
releaseNotes+=$'\r\n'
|
||||||
fi
|
fi
|
||||||
@ -368,9 +368,9 @@ done
|
|||||||
rm -f $commitFile
|
rm -f $commitFile
|
||||||
|
|
||||||
# Prepend the original release body
|
# Prepend the original release body
|
||||||
if [ "${RELEASE_BODY: -1}" == $'\r' ]; then
|
if [ "${RELEASE_BODY: -1}" == $'\r' ]; then
|
||||||
RELEASE_BODY="${RELEASE_BODY:0:-1}"
|
RELEASE_BODY="${RELEASE_BODY:0:-1}"
|
||||||
else
|
else
|
||||||
RELEASE_BODY="$RELEASE_BODY"
|
RELEASE_BODY="$RELEASE_BODY"
|
||||||
fi
|
fi
|
||||||
RELEASE_BODY+=$'\r\n'
|
RELEASE_BODY+=$'\r\n'
|
||||||
|
Reference in New Issue
Block a user