From 73b1bc8e37966e3eeeb2635d3be92265ad5b8f6f Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Fri, 3 Apr 2026 18:20:18 +0300 Subject: [PATCH 1/6] Add GitHub Actions release workflow for multi-toolchain builds Build uget for all 6 HiSilicon toolchains (hisiv300, hisiv500, hisiv510, hisiv600, himix100, himix200) using matrix strategy. Downloads toolchains from OpenIPC/toolchains release assets. Produces uget binary and uget.sh per toolchain, published as GitHub release assets on tag push. Closes #1 Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/release.yml | 93 +++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1b1822c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,93 @@ +name: Build and Release + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - toolchain: arm-hisiv300-linux + archive: arm-hisiv300-linux.tar.bz2 + cross_compile: arm-hisiv300-linux-uclibcgnueabi- + - toolchain: arm-hisiv500-linux + archive: arm-hisiv500-linux.tgz + cross_compile: arm-hisiv500-linux-uclibcgnueabi- + - toolchain: arm-hisiv510-linux + archive: arm-hisiv510-linux.tgz + cross_compile: arm-hisiv510-linux-uclibcgnueabi- + - toolchain: arm-hisiv600-linux + archive: arm-hisiv600-linux.tgz + cross_compile: arm-hisiv600-linux-gnueabi- + - toolchain: arm-himix100-linux + archive: arm-himix100-linux.tgz + cross_compile: arm-himix100-linux- + - toolchain: arm-himix200-linux + archive: arm-himix200-linux.tgz + cross_compile: arm-himix200-linux- + steps: + - uses: actions/checkout@v4 + + - name: Install upx + run: sudo apt-get update && sudo apt-get install -y upx-ucl + + - name: Download toolchain + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if [ "${{ matrix.toolchain }}" = "arm-himix200-linux" ]; then + gh release download v1 -R OpenIPC/toolchains -p 'arm-himix200-linux.tgz.part*' + cat arm-himix200-linux.tgz.part* > arm-himix200-linux.tgz + rm arm-himix200-linux.tgz.part* + else + gh release download v1 -R OpenIPC/toolchains -p '${{ matrix.archive }}' + fi + + - name: Extract toolchain + run: | + if [ "${{ matrix.archive }}" = "arm-hisiv300-linux.tar.bz2" ]; then + tar xjf arm-hisiv300-linux.tar.bz2 + else + tar xzf ${{ matrix.toolchain }}.tgz + tar xjf ${{ matrix.toolchain }}/${{ matrix.toolchain }}.tar.bz2 + fi + + - name: Build bin2sh (native) + run: make bin2sh + + - name: Build uget (cross-compile) + run: | + export PATH="$PWD/${{ matrix.toolchain }}/bin:$PATH" + make uget CROSS_COMPILE=${{ matrix.cross_compile }} + + - name: Generate uget.sh + run: ./bin2sh uget > uget.sh + + - name: Rename artifacts + run: | + mv uget uget.${{ matrix.toolchain }} + mv uget.sh uget.${{ matrix.toolchain }}.sh + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: uget-${{ matrix.toolchain }} + path: | + uget.${{ matrix.toolchain }} + uget.${{ matrix.toolchain }}.sh + + release: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + files: uget-*/* From 2dff47d1055d4e7c88955f4be4f49e073e093b9d Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Fri, 3 Apr 2026 18:31:18 +0300 Subject: [PATCH 2/6] Add pull_request trigger for CI testing Skip release job on PRs since it requires a tag. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1b1822c..1d43856 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: tags: - 'v*' + pull_request: jobs: build: @@ -81,6 +82,7 @@ jobs: uget.${{ matrix.toolchain }}.sh release: + if: startsWith(github.ref, 'refs/tags/') needs: build runs-on: ubuntu-latest steps: From bd4f74dd6e31b0d41667828c8b0ba61e829e5262 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Fri, 3 Apr 2026 18:32:09 +0300 Subject: [PATCH 3/6] Trigger CI From dee07990b214433db48640f91e9d6a7e598fcdf7 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Fri, 3 Apr 2026 18:35:20 +0300 Subject: [PATCH 4/6] Fix CI: install 32-bit libs for i386 toolchain binaries All HiSilicon toolchains are 32-bit x86 ELF binaries. The assembler needs lib32z1, and gcc-multilib provides the 32-bit loader and libc. Also set fail-fast: false so all matrix jobs run independently. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d43856..7a63c4b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,7 @@ jobs: build: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: include: - toolchain: arm-hisiv300-linux @@ -33,8 +34,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install upx - run: sudo apt-get update && sudo apt-get install -y upx-ucl + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y upx-ucl lib32z1 gcc-multilib - name: Download toolchain env: From 42de909a5fa801c1b9c4b87e4c9af294ed418b77 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Fri, 3 Apr 2026 18:37:36 +0300 Subject: [PATCH 5/6] Make upx compression non-fatal in Makefile UPX throws NotCompressibleException on very small binaries (e.g., when built with some toolchains). Prefix with - so make continues on failure. Co-Authored-By: Claude Opus 4.6 (1M context) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b374892..2d6e841 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ all: $(BINARIES) uget: uget.o $(CC) $(CFLAGS) -o $@ $^ $(STRIP) -R .comment -R .note -R .note.ABI-tag $@ - upx $@ + -upx $@ bin2sh: bin2sh.c cc -o $@ $^ From c8fe3d0922b8247ebc7d5c1e872614280a0f6dad Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Fri, 3 Apr 2026 18:44:53 +0300 Subject: [PATCH 6/6] Add SoC-to-binary mapping table in release notes Helps end users pick the right binary for their device. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/release.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a63c4b..fefcd75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,3 +94,19 @@ jobs: uses: softprops/action-gh-release@v2 with: files: uget-*/* + body: | + ## Which binary do I need? + + | Your SoC | Libc | Binary | + |----------|------|--------| + | Hi3516Av100, Hi3518Ev200 | uClibc | `uget.arm-hisiv300-linux` | + | Hi3516Cv300, Hi3518Ev201 | uClibc | `uget.arm-hisiv500-linux` | + | Hi3516Cv300, Hi3518Ev201 | glibc | `uget.arm-hisiv600-linux` | + | Hi3516Av200, Hi3519v101 | uClibc | `uget.arm-hisiv510-linux` | + | Hi3516Av200, Hi3519v101 | glibc | `uget.arm-hisiv600-linux` | + | Hi3516EV200, Hi3516EV300, Hi3518EV300, Hi3516DV200 | uClibc | `uget.arm-himix100-linux` | + | Hi3516CV500, Hi3516DV300, Hi3519Av100 | glibc | `uget.arm-himix200-linux` | + + If unsure about libc, try the uClibc variant first — it has fewer dependencies. + + Each binary also has a matching `.sh` file (e.g., `uget.arm-hisiv510-linux.sh`) for transferring via telnet copy-paste.