From 6fcd7ff6eda9872f5d5ca8d86dedabbc2a15fbdb Mon Sep 17 00:00:00 2001 From: Conrad Kramer Date: Wed, 18 Mar 2026 23:44:19 -0700 Subject: [PATCH] Install Rust directly in Apple workflow --- .forgejo/workflows/build-apple.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/build-apple.yml b/.forgejo/workflows/build-apple.yml index 32c6903..27274c8 100644 --- a/.forgejo/workflows/build-apple.yml +++ b/.forgejo/workflows/build-apple.yml @@ -63,10 +63,30 @@ jobs: DEVELOPER_DIR="$selected" /usr/bin/xcodebuild -version || true - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.85.0 - targets: ${{ matrix.rust-targets }} + shell: bash + run: | + set -euo pipefail + export RUSTUP_HOME="${HOME}/.rustup" + export CARGO_HOME="${HOME}/.cargo" + + if ! command -v rustup >/dev/null 2>&1; then + curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.85.0 + else + rustup set profile minimal + rustup toolchain install 1.85.0 + rustup default 1.85.0 + fi + + echo "${CARGO_HOME}/bin" >> "${GITHUB_PATH}" + . "${CARGO_HOME}/env" + + targets='${{ matrix.rust-targets }}' + for target in ${targets//,/ }; do + rustup target add "${target}" + done + + rustc --version + cargo --version - name: Install Protobuf shell: bash