From 9eb464790e4706ae3465127335a5fa1471e26039 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sat, 13 May 2023 09:48:58 +0200 Subject: [PATCH] changed jkbms_ble to dev (#631) * changed jkbms_ble to dev * changed order * test automatic release version change * test automatic release version change * test automatic release version change * added option in bug issue template --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + .github/workflows/release-beta.yml | 10 ++++++++++ .github/workflows/release.yml | 10 ++++++++++ etc/dbus-serialbattery/install.sh | 24 +++++++++++------------- 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index df191642..59070773 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -119,6 +119,7 @@ body: - Please select - Serial USB adapter to TTL - Serial USB adapter to RS485 + - Raspberry Pi RS485 HAT - Bluetooth validations: required: true diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index f5a4ed4a..f1634f34 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -17,6 +17,16 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Replace version string + run: | + echo $GITHUB_REF_NAME + VERSION=$(echo $GITHUB_REF_NAME | sed 's/^v//') + echo $VERSION + echo + head -n 39 etc/dbus-serialbattery/utils.py | tail -n 3 + sed -i --regexp-extended --expression="s/[0-9]+\.[0-9]+\.[0-9a-z\_\-]+/$VERSION/" "etc/dbus-serialbattery/utils.py" + head -n 39 etc/dbus-serialbattery/utils.py | tail -n 3 + - name: build release archive run: | find . -type f -name "*.py" -exec chmod +x {} \; diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0da358dd..55403a70 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,16 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Replace version string + run: | + echo $GITHUB_REF_NAME + VERSION=$(echo $GITHUB_REF_NAME | sed 's/^v//') + echo $VERSION + echo + head -n 39 etc/dbus-serialbattery/utils.py | tail -n 3 + sed -i --regexp-extended --expression="s/[0-9]+\.[0-9]+\.[0-9a-z\_\-]+/$VERSION/" "etc/dbus-serialbattery/utils.py" + head -n 39 etc/dbus-serialbattery/utils.py | tail -n 3 + - name: build release archive run: | find . -type f -name "*.py" -exec chmod +x {} \; diff --git a/etc/dbus-serialbattery/install.sh b/etc/dbus-serialbattery/install.sh index 57e09e6a..17a12ed3 100755 --- a/etc/dbus-serialbattery/install.sh +++ b/etc/dbus-serialbattery/install.sh @@ -6,7 +6,7 @@ echo "" PS3="Select which version you want to install and enter the corresponding number [1]: " -select version in "latest release (recommended)" "nightly build" "local tar file" "specific version" "quit" +select version in "latest release (recommended)" "specific version" "nightly build" "local tar file" "quit" do case $version in "latest release (recommended)") @@ -14,17 +14,17 @@ do #echo "Selected number: $REPLY" break ;; - "nightly build") + "specific version") echo "Selected: $version" #echo "Selected number: $REPLY" break ;; - "local tar file") + "nightly build") echo "Selected: $version" #echo "Selected number: $REPLY" break ;; - "specific version") + "local tar file") echo "Selected: $version" #echo "Selected number: $REPLY" break @@ -46,11 +46,6 @@ if [ "$version" = "latest release (recommended)" ]; then curl -s https://api.github.com/repos/Louisvdw/dbus-serialbattery/releases/latest | grep "browser_download_url.*gz" | cut -d : -f 2,3 | tr -d \" | wget -O /tmp/venus-data.tar.gz -qi - fi -## local tar file -if [ "$version" = "local tar file" ]; then - echo "Make sure the file is available at \"/var/volatile/tmp/venus-data.tar.gz\"" -fi - ## specific version if [ "$version" = "specific version" ]; then # read the url @@ -62,7 +57,10 @@ if [ "$version" = "specific version" ]; then fi fi - +## local tar file +if [ "$version" = "local tar file" ]; then + echo "Make sure the file is available at \"/var/volatile/tmp/venus-data.tar.gz\"" +fi # backup config.ini if [ -f "/data/etc/dbus-serialbattery/config.ini" ]; then @@ -72,7 +70,7 @@ fi ## extract the tar file -if [ "$version" = "latest release (recommended)" ] || [ "$version" = "local tar file" ] || [ "$version" = "specific version" ]; then +if [ "$version" = "latest release (recommended)" ] || [ "$version" = "specific version" ] || [ "$version" = "local tar file" ]; then # extract driver if [ -f "/tmp/venus-data.tar.gz" ]; then @@ -96,7 +94,7 @@ if [ "$version" = "nightly build" ]; then PS3="Select the branch from wich you want to install the current code (possible bugs included): " - select branch in master jkbms_ble quit + select branch in master dev quit do case $branch in master) @@ -104,7 +102,7 @@ if [ "$version" = "nightly build" ]; then #echo "Selected number: $REPLY" break ;; - jkbms_ble) + dev) echo "Selected branch: $branch" #echo "Selected number: $REPLY" break