From 4fb129b035956e70878afed6f91dd6639088d8a6 Mon Sep 17 00:00:00 2001 From: RobertByrnes Date: Tue, 23 Jul 2024 20:59:00 +0100 Subject: [PATCH] chore: update workflow to build from hotfix branch --- .github/workflows/arduino_examples.yml | 2 +- .../scripts/install_sslclient_for_testing.sh | 48 ++++++++++++++++++- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/.github/workflows/arduino_examples.yml b/.github/workflows/arduino_examples.yml index 6964361..c042d61 100644 --- a/.github/workflows/arduino_examples.yml +++ b/.github/workflows/arduino_examples.yml @@ -34,7 +34,7 @@ jobs: - name: Install specific branch of GovoroxSSLClient run: | mkdir -p ~/Arduino/libraries - git clone --branch v1.3.0 https://github.com/govorox/SSLClient.git ~/Arduino/libraries/GovoroxSSLClient + git clone --branch 95-release-130-fails-to-compile-on-arduino-esp32-v3 https://github.com/govorox/SSLClient.git ~/Arduino/libraries/GovoroxSSLClient - name: Install other libs run: | diff --git a/.github/workflows/scripts/install_sslclient_for_testing.sh b/.github/workflows/scripts/install_sslclient_for_testing.sh index 8a9b5c2..df18c2c 100755 --- a/.github/workflows/scripts/install_sslclient_for_testing.sh +++ b/.github/workflows/scripts/install_sslclient_for_testing.sh @@ -1,12 +1,56 @@ #!/usr/bin/bash +# Function to print usage +print_usage() { + echo "Usage: $0 [--branch ]" + echo " --branch Specify the branch to checkout (default: master)" +} + +# Default branch name +BRANCH="master" + +# Parse command line arguments +while [[ "$#" -gt 0 ]]; do + case $1 in + --branch) + if [[ -n $2 && ! $2 =~ ^- ]]; then + BRANCH=$2 + shift + else + echo "Error: --branch requires a non-empty option argument." + print_usage + exit 1 + fi + ;; + *) + echo "Unknown parameter passed: $1" + print_usage + exit 1 + ;; + esac + shift +done + +# Remove previous SSLClient directory if exists rm -rf ~/SSLClient + +# Clone the repository git clone https://github.com/govorox/SSLClient.git ~/SSLClient -cd ~/SSLClient -git checkout 95-release-130-fails-to-compile-on-arduino-esp32-v3 + +# Navigate to the cloned directory +cd ~/SSLClient || { echo "Failed to change directory to ~/SSLClient"; exit 1; } + +# Checkout the specified branch +git checkout "$BRANCH" + +# Prepare the directory for zipping mkdir -p SSLClient mv LICENSE library.properties src SSLClient/ zip -r SSLClient.zip SSLClient + +# Create Arduino CLI configuration directory and file if not exists mkdir -p ~/.arduino15 echo -e "library:\n enable_unsafe_install: true" > ~/.arduino15/arduino-cli.yaml + +# Install the library using Arduino CLI arduino-cli lib install --config-file ~/.arduino15/arduino-cli.yaml --zip-path SSLClient.zip