From 6b983a06bbc90a040b17a33a6ee10989130f24e9 Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 07:40:11 -0300 Subject: [PATCH 01/15] test: upload firmware to telegram + Emojis --- .github/workflows/CI.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 75edf970b4..12a90049c7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,7 +11,7 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: build: - name: build + name: build 🏗️ runs-on: ubuntu-20.04 if: ${{ !(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) }} env: @@ -30,24 +30,24 @@ jobs: # targets: "MI-R3G JCG-AC860M NETGEAR-BZV MI-R3P R2100 RM2100 MSG1500 BELL-A040WQ" steps: - uses: actions/checkout@v2 - - name: Prepare environment + - name: Prepare environment 🪚 run: | sudo apt update sudo apt install libtool-bin gperf python3-docutils autopoint gettext - - name: Run shellcheck + - name: Run shell check 🛠️ run: sh ./trunk/tools/shellcheck.sh - name: Prepare toolchain run: | cd toolchain-mipsel sh dl_toolchain.sh - - name: Start build + - name: Start build 🏗️ run: | cd trunk mkdir -p ${images_dir} for m in $targets; do fakeroot ./build_firmware_ci $m; \ if [ $? = 0 ]; then cp -f images/*.trx ${images_dir}/$m.trx; else exit 1; fi; \ ./clear_tree_simple >/dev/null 2>&1; done - - name: Create archive + - name: Create archive 💾 if: ${{ github.event_name != 'release' && success() }} run: | ls -lh ${images_dir} @@ -55,19 +55,19 @@ jobs: image_name=images_${build_variant}_${GIT_VERSION} || image_name=images_${build_variant} cd ${images_dir}; md5sum *.trx |tee md5sum.txt; 7z a -mx=9 ${image_name}.7z ./* echo "image_name=${image_name}" >> $GITHUB_ENV - - name: Upload images to Artifact + - name: Upload images to Artifact 📤 if: ${{ github.event_name != 'release' && success() }} uses: actions/upload-artifact@v2.2.1 with: name: ${{ env.image_name }} path: ${{ env.images_dir }}/*.7z - - name: Upload firmware to 1Fichier + - name: Upload firmware to 1Fichier 🌐 run: | curl -fsSL git.io/file-transfer | sh ./transfer fic -p 16 --no-progress /opt/images/*.trx 2>&1 | tee 1fichier.log echo "download_link=$(<1fichier.log)" >> $GITHUB_ENV echo ${{ env.download_link }} - - name: Send Download link to Telegram 🔗 + - name: Send Download link to Telegram ✉️ if: ${{ github.event_name != 'release' && success() }} uses: appleboy/telegram-action@master with: @@ -86,7 +86,14 @@ jobs: ```text ${{ env.download_link }} ``` - - name: Upload images to Releases + - name: Send firmware file to Telegram 📩 + if: ${{ github.event_name != 'release' && success() }} + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_TO }} + token: ${{ secrets.TELEGRAM_TOKEN }} + message_file: ${images_dir}/* + - name: Upload images to Releases 📤 if: ${{ github.event_name == 'release' && success() }} uses: svenstaro/upload-release-action@2.2.0 with: From bd48c3d7c1fd11e30def5ac42dff5b63d914ffaf Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 08:01:52 -0300 Subject: [PATCH 02/15] test: new server and upload to telegram * 1ficher to transfer.sh --- .github/workflows/CI.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 12a90049c7..24a40aec94 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -36,7 +36,7 @@ jobs: sudo apt install libtool-bin gperf python3-docutils autopoint gettext - name: Run shell check 🛠️ run: sh ./trunk/tools/shellcheck.sh - - name: Prepare toolchain + - name: Prepare toolchain 🔗 run: | cd toolchain-mipsel sh dl_toolchain.sh @@ -64,9 +64,9 @@ jobs: - name: Upload firmware to 1Fichier 🌐 run: | curl -fsSL git.io/file-transfer | sh - ./transfer fic -p 16 --no-progress /opt/images/*.trx 2>&1 | tee 1fichier.log - echo "download_link=$(<1fichier.log)" >> $GITHUB_ENV - echo ${{ env.download_link }} + ./transfer trs -p 16 --no-progress /opt/images/*.trx 2>&1 | tee log.log + cat log.log + echo "download_link=$(> $GITHUB_ENV - name: Send Download link to Telegram ✉️ if: ${{ github.event_name != 'release' && success() }} uses: appleboy/telegram-action@master @@ -92,7 +92,7 @@ jobs: with: to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} - message_file: ${images_dir}/* + message_file: ${images_dir}/*.trx - name: Upload images to Releases 📤 if: ${{ github.event_name == 'release' && success() }} uses: svenstaro/upload-release-action@2.2.0 From 7a9a6fa1d7bce8c50e4c3d0f17ad86c55c92cc06 Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 08:10:33 -0300 Subject: [PATCH 03/15] test: new server and upload to telegram * 1ficher to Transfer.sh + Debug log to view download link on build log * Changed location of file on telegram step to only ".trx" files --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 24a40aec94..439e9c71fc 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -61,7 +61,7 @@ jobs: with: name: ${{ env.image_name }} path: ${{ env.images_dir }}/*.7z - - name: Upload firmware to 1Fichier 🌐 + - name: Upload firmware to Transfer.sh 🌐 run: | curl -fsSL git.io/file-transfer | sh ./transfer trs -p 16 --no-progress /opt/images/*.trx 2>&1 | tee log.log From 0779bf1d5d86cbd426ae5fe6c85c29dd3ae0746b Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 08:43:12 -0300 Subject: [PATCH 04/15] test: upload firmware * Only testing alternatives --- .github/workflows/CI.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 439e9c71fc..1200f79ee1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -66,7 +66,8 @@ jobs: curl -fsSL git.io/file-transfer | sh ./transfer trs -p 16 --no-progress /opt/images/*.trx 2>&1 | tee log.log cat log.log - echo "download_link=$(> $GITHUB_ENV + download_link=$(> $GITHUB_ENV - name: Send Download link to Telegram ✉️ if: ${{ github.event_name != 'release' && success() }} uses: appleboy/telegram-action@master From 492f1938a7256b4153ec73493a3c598d1f5d5cef Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 08:55:23 -0300 Subject: [PATCH 05/15] test: upload firmware * Only testing alternative --- .github/workflows/CI.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1200f79ee1..c1f2178242 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -66,7 +66,9 @@ jobs: curl -fsSL git.io/file-transfer | sh ./transfer trs -p 16 --no-progress /opt/images/*.trx 2>&1 | tee log.log cat log.log - download_link=$(> $GITHUB_ENV - name: Send Download link to Telegram ✉️ if: ${{ github.event_name != 'release' && success() }} From e0bc6a37fc6b4f7ff1df8d1140c20adf5d1f2ed2 Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 09:11:03 -0300 Subject: [PATCH 06/15] test: upload firmware - Fix argument invalid on upload file --- .github/workflows/CI.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c1f2178242..6e440557ff 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -64,11 +64,10 @@ jobs: - name: Upload firmware to Transfer.sh 🌐 run: | curl -fsSL git.io/file-transfer | sh - ./transfer trs -p 16 --no-progress /opt/images/*.trx 2>&1 | tee log.log + ./transfer trs --no-progress /opt/images/*.trx 2>&1 | tee log.log cat log.log - while read download_link; do - echo $download_link - done < log.log + download_link=`cat log.log` + echo "$download_link" echo "download_link=${download_link}" >> $GITHUB_ENV - name: Send Download link to Telegram ✉️ if: ${{ github.event_name != 'release' && success() }} From 082c23521285540d59da2ca5254833435475c112 Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 09:53:00 -0300 Subject: [PATCH 07/15] test: upload firmware --- .github/workflows/CI.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6e440557ff..a98e42d2da 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -80,7 +80,8 @@ jobs: message: | Commit message: ${{ github.event.commits[0].message }} - [Repository](${{ github.repository }}) + [Repository](https://github.com/${{ github.repository }}) + [Releases](https://github.com/${{ github.repository }}/releases) See changes: [Changes](https://github.com/${{ github.repository }}/commit/${{github.sha}}) From f990846b9c59dce159d6242852be2d7343323b27 Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 10:09:00 -0300 Subject: [PATCH 08/15] test: upload firmware --- .github/workflows/CI.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a98e42d2da..57e03b1d9c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -63,12 +63,11 @@ jobs: path: ${{ env.images_dir }}/*.7z - name: Upload firmware to Transfer.sh 🌐 run: | + echo "download_link="" >> $GITHUB_ENV curl -fsSL git.io/file-transfer | sh ./transfer trs --no-progress /opt/images/*.trx 2>&1 | tee log.log - cat log.log download_link=`cat log.log` - echo "$download_link" - echo "download_link=${download_link}" >> $GITHUB_ENV + echo "download_link=${env.download_link}" >> $GITHUB_ENV - name: Send Download link to Telegram ✉️ if: ${{ github.event_name != 'release' && success() }} uses: appleboy/telegram-action@master From 2c2c1f76f9df01649cce4749d26fe22683d450e9 Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 10:25:53 -0300 Subject: [PATCH 09/15] test: upload firmware * Try fix with changing method of parsing a variable --- .github/workflows/CI.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 57e03b1d9c..34fe91ec16 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -63,11 +63,9 @@ jobs: path: ${{ env.images_dir }}/*.7z - name: Upload firmware to Transfer.sh 🌐 run: | - echo "download_link="" >> $GITHUB_ENV curl -fsSL git.io/file-transfer | sh ./transfer trs --no-progress /opt/images/*.trx 2>&1 | tee log.log - download_link=`cat log.log` - echo "download_link=${env.download_link}" >> $GITHUB_ENV + download_link=`cat log.log` >> $GITHUB_ENV - name: Send Download link to Telegram ✉️ if: ${{ github.event_name != 'release' && success() }} uses: appleboy/telegram-action@master @@ -75,7 +73,6 @@ jobs: to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} format: markdown - document: ${images_dir}/* message: | Commit message: ${{ github.event.commits[0].message }} From 0cb7505c93f37083f08f97c644b801008013ed22 Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 11:26:13 -0300 Subject: [PATCH 10/15] test: upload firmware * Fix for telegram --- .github/workflows/CI.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 34fe91ec16..e6e2a2511f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -72,19 +72,16 @@ jobs: with: to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} - format: markdown message: | Commit message: ${{ github.event.commits[0].message }} - [Repository](https://github.com/${{ github.repository }}) - [Releases](https://github.com/${{ github.repository }}/releases) + Repository: https://github.com/${{ github.repository }} + Releases: https://github.com/${{ github.repository }}/releases - See changes: [Changes](https://github.com/${{ github.repository }}/commit/${{github.sha}}) + See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}} - Download Link: - ```text + Download Link: ${{ env.download_link }} - ``` - name: Send firmware file to Telegram 📩 if: ${{ github.event_name != 'release' && success() }} uses: appleboy/telegram-action@master From 4df6db279324dd930003a32dcb706b05428d50f0 Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 11:49:54 -0300 Subject: [PATCH 11/15] test: upload firmware * Alternative --- .github/workflows/CI.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e6e2a2511f..842c37447c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -63,9 +63,10 @@ jobs: path: ${{ env.images_dir }}/*.7z - name: Upload firmware to Transfer.sh 🌐 run: | - curl -fsSL git.io/file-transfer | sh - ./transfer trs --no-progress /opt/images/*.trx 2>&1 | tee log.log - download_link=`cat log.log` >> $GITHUB_ENV + curl -fsSL git.io/file-transfer | sh + ./transfer trs --no-progress /opt/images/*.trx 2>&1 | tee log.log + echo "::warning file=transfer.sh::$(cat log.log | grep https)" + echo "download_link=$(cat log.log | grep https)" >> $GITHUB_ENV - name: Send Download link to Telegram ✉️ if: ${{ github.event_name != 'release' && success() }} uses: appleboy/telegram-action@master From 096a6e21d45a751df3d32a0be9c4b42b675cf776 Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 17:06:05 -0300 Subject: [PATCH 12/15] test: upload firmware to telegram = All fixed * Changed variable environment --- .github/workflows/CI.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 842c37447c..7bd2f0353a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -81,7 +81,6 @@ jobs: See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}} - Download Link: ${{ env.download_link }} - name: Send firmware file to Telegram 📩 if: ${{ github.event_name != 'release' && success() }} @@ -89,7 +88,7 @@ jobs: with: to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} - message_file: ${images_dir}/*.trx + message_file: ${{ env.images_dir }}/${{ env.image_name }}.trx - name: Upload images to Releases 📤 if: ${{ github.event_name == 'release' && success() }} uses: svenstaro/upload-release-action@2.2.0 From a285c251b053b7a08eb4c69a991cb590b4ad74ca Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 17:09:26 -0300 Subject: [PATCH 13/15] test: rename step * Rollback to a original name "shellcheck" --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7bd2f0353a..e694e7cdad 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -34,7 +34,7 @@ jobs: run: | sudo apt update sudo apt install libtool-bin gperf python3-docutils autopoint gettext - - name: Run shell check 🛠️ + - name: Run shellcheck 🛠️ run: sh ./trunk/tools/shellcheck.sh - name: Prepare toolchain 🔗 run: | From dac8b38bed77a3c32ace16f93d5ece25c79a557d Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Sun, 3 Sep 2023 18:16:35 -0300 Subject: [PATCH 14/15] test: upload firmware to telegram --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e694e7cdad..df767c2253 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -88,7 +88,7 @@ jobs: with: to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} - message_file: ${{ env.images_dir }}/${{ env.image_name }}.trx + message_file: ${{ env.images_dir }}/${{ env.targets }}.trx - name: Upload images to Releases 📤 if: ${{ github.event_name == 'release' && success() }} uses: svenstaro/upload-release-action@2.2.0 From 9959817de4d95fe559ff45fefdde99eba63d8729 Mon Sep 17 00:00:00 2001 From: Gustavo Mathias Rocha Date: Mon, 4 Sep 2023 09:04:15 -0300 Subject: [PATCH 15/15] build: First build on main --- .github/workflows/CI.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index df767c2253..fa86e6e984 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -82,13 +82,6 @@ jobs: See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}} ${{ env.download_link }} - - name: Send firmware file to Telegram 📩 - if: ${{ github.event_name != 'release' && success() }} - uses: appleboy/telegram-action@master - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_TOKEN }} - message_file: ${{ env.images_dir }}/${{ env.targets }}.trx - name: Upload images to Releases 📤 if: ${{ github.event_name == 'release' && success() }} uses: svenstaro/upload-release-action@2.2.0