Install make for nu building #372
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # REF: | |
| # 1. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrixinclude | |
| # | |
| name: Build Loongarch64 Musl Binary | |
| on: | |
| push: | |
| branches: | |
| - release/loong64-musl | |
| tags: | |
| - 'v*' | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| standard: | |
| name: Std | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - loongarch64-unknown-linux-musl | |
| extra: ['bin'] | |
| include: | |
| - target: loongarch64-unknown-linux-musl | |
| os: ubuntu-22.04 | |
| runs-on: ${{matrix.os}} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update Rust Toolchain Target | |
| run: | | |
| echo "targets = ['${{matrix.target}}']" >> rust-toolchain.toml | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1.9.0 | |
| # WARN: Keep the rustflags to prevent from the winget submission error: `CAQuietExec: Error 0xc0000135` | |
| with: | |
| cache: false | |
| rustflags: '' | |
| - name: Setup Nushell | |
| uses: hustcer/setup-nu@v3 | |
| with: | |
| version: 0.103.0 | |
| - name: Setup Cross-compilation Environment | |
| run: | | |
| # Install necessary packages for LoongArch64 cross-compilation | |
| sudo apt-get update | |
| sudo apt-get install -y qemu-user-static | |
| - name: Release Nu Binary | |
| id: nu | |
| run: | | |
| # Use Alpine LoongArch64 image for cross-compilation | |
| docker run --rm --privileged loongcr.lcpu.dev/multiarch/archlinux --reset -p yes | |
| # Use official Alpine image from Docker Hub for cross-compilation | |
| docker run --rm \ | |
| --platform linux/loong64 \ | |
| -v "$(pwd)":/workspace \ | |
| -w /workspace \ | |
| loongarch64/alpine:3.21 \ | |
| sh -c "\ | |
| apk add --no-cache curl make gcc perl musl-dev openssl-dev openssl-libs-static && \ | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable && \ | |
| source ~/.cargo/env && \ | |
| rustup target add loongarch64-unknown-linux-musl && \ | |
| RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --target loongarch64-unknown-linux-musl --features=static-link-openssl\ | |
| " | |