chore: use hermit to install node, rust and protoc (#2766)

This commit is contained in:
Lifei Zhou
2025-06-04 09:45:43 +10:00
committed by GitHub
parent 5574c20ff2
commit d1f9d4a31e
36 changed files with 170 additions and 82 deletions

View File

@@ -20,6 +20,10 @@ on:
type: string
required: false
default: '["x86_64","aarch64"]'
ref:
type: string
required: false
default: 'refs/heads/main'
name: "Reusable workflow to build CLI"
@@ -41,6 +45,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
- name: Update version in Cargo.toml
if: ${{ inputs.version != '' }}
@@ -48,14 +55,8 @@ jobs:
sed -i.bak 's/^version = ".*"/version = "'${{ inputs.version }}'"/' Cargo.toml
rm -f Cargo.toml.bak
- name: Setup Rust
uses: dtolnay/rust-toolchain@38b70195107dddab2c7bbd522bcf763bac00963b # pin@stable
with:
toolchain: stable
target: ${{ matrix.architecture }}-${{ matrix.target-suffix }}
- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross
run: source ./bin/activate-hermit && cargo install cross --git https://github.com/cross-rs/cross
- name: Build CLI
env:
@@ -64,12 +65,7 @@ jobs:
RUST_BACKTRACE: 1
CROSS_VERBOSE: 1
run: |
# Install protoc if on macOS
if [ "${{ matrix.os }}" = "macos-latest" ]; then
brew install protobuf
export PROTOC=$(which protoc)
fi
source ./bin/activate-hermit
export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"
rustup target add "${TARGET}"
echo "Building for target: ${TARGET}"