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