From ba0f198e2eab384845c5eb02c9008816980e003f Mon Sep 17 00:00:00 2001 From: vazub Date: Fri, 7 Aug 2026 09:24:43 +0200 Subject: [PATCH 1/5] Add -musl targets Support building statically-linked loon CLI binaries on Linux, using musl libc. --- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db8fdd6..1b89d2e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,10 @@ jobs: os: ubuntu-latest - target: aarch64-unknown-linux-gnu os: ubuntu-latest + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + - target: aarch64-unknown-linux-musl + os: ubuntu-latest - target: x86_64-apple-darwin os: macos-latest - target: aarch64-apple-darwin @@ -24,22 +28,43 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # needed for git-describe version + fetch-depth: 0 # needed for git-describe version - uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} - - name: Install cross-compilation tools + - name: Install cross-compilation tools (aarch64-gnu) if: matrix.target == 'aarch64-unknown-linux-gnu' run: | sudo apt-get update sudo apt-get install -y gcc-aarch64-linux-gnu echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + - name: Install musl tools (x86_64-musl) + if: matrix.target == 'x86_64-unknown-linux-musl' + run: | + sudo apt-get update + sudo apt-get install -y musl-tools + + - name: Install cross (aarch64-musl) + if: matrix.target == 'aarch64-unknown-linux-musl' + run: cargo install cross --git https://github.com/cross-rs/cross + - name: Build + if: matrix.target != 'aarch64-unknown-linux-musl' run: cargo build --release --target ${{ matrix.target }} -p loon-cli + - name: Build (cross) + if: matrix.target == 'aarch64-unknown-linux-musl' + run: cross build --release --target ${{ matrix.target }} -p loon-cli + + - name: Verify static linking + if: contains(matrix.target, 'musl') + run: | + file target/${{ matrix.target }}/release/loon + ldd target/${{ matrix.target }}/release/loon || true + - name: Package run: | TAG=${GITHUB_REF#refs/tags/} From 66f2772a49c003105511bea4de2101794c9038f5 Mon Sep 17 00:00:00 2001 From: vazub Date: Fri, 7 Aug 2026 09:43:56 +0200 Subject: [PATCH 2/5] Upgrade actions ot Node24 Node20 is deprecated - https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/ --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1b89d2e..9497240 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: os: macos-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 # needed for git-describe version @@ -73,7 +73,7 @@ jobs: tar czf "$ARCHIVE" loon echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v6 with: name: ${{ matrix.target }} path: ${{ env.ARCHIVE }} @@ -82,7 +82,7 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v6 with: merge-multiple: true From 9a83d0ed2309e197cf33a0705ad43c6421de579f Mon Sep 17 00:00:00 2001 From: vazub Date: Fri, 7 Aug 2026 16:36:39 +0200 Subject: [PATCH 3/5] more Node24 fixes --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9497240..c1132d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,7 +82,7 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v6 + - uses: actions/download-artifact@v7 with: merge-multiple: true From ed765ce1a794d841aa83846c2c7b7318dc451efc Mon Sep 17 00:00:00 2001 From: vazub Date: Fri, 7 Aug 2026 17:39:46 +0200 Subject: [PATCH 4/5] Use pre-built dev tools Avoids wasting time on tools compilation with every release. --- .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 c1132d5..c0a596a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,8 +48,9 @@ jobs: sudo apt-get install -y musl-tools - name: Install cross (aarch64-musl) - if: matrix.target == 'aarch64-unknown-linux-musl' - run: cargo install cross --git https://github.com/cross-rs/cross + uses: taiki-e/install-action@v2 + with: + tool: cross@0.2.5 - name: Build if: matrix.target != 'aarch64-unknown-linux-musl' From f1e3730a664fc40974001870b50b0d947d313837 Mon Sep 17 00:00:00 2001 From: vazub Date: Fri, 7 Aug 2026 17:53:18 +0200 Subject: [PATCH 5/5] Add 'if' guard for cross install Cross should be installed for aarch64-musl matrix leg only, to minimize resource waste. --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c0a596a..aa41d01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,6 +48,7 @@ jobs: sudo apt-get install -y musl-tools - name: Install cross (aarch64-musl) + if: matrix.target == 'aarch64-unknown-linux-musl' uses: taiki-e/install-action@v2 with: tool: cross@0.2.5