Skip to content

Commit 6e90999

Browse files
committed
Fix APK workflow Rust setup
1 parent b7f3397 commit 6e90999

1 file changed

Lines changed: 15 additions & 19 deletions

File tree

.github/workflows/build-apk.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,34 +53,30 @@ jobs:
5353
- name: Check distribution
5454
run: uv run twine check dist/*
5555

56+
- name: Install Rust
57+
run: |
58+
rustup toolchain install "$RUST_TOOLCHAIN" --profile minimal
59+
rustup default "$RUST_TOOLCHAIN"
60+
rustc --version
61+
cargo --version
62+
5663
- name: Build Android APK with Buildozer Docker image
5764
shell: bash
5865
run: |
5966
set -o pipefail
67+
mkdir -p .buildozer bin
68+
sudo chown -R 1000:1000 .buildozer bin
6069
6170
docker run --rm \
62-
--entrypoint bash \
71+
-e RUSTUP_HOME=/home/user/.rustup \
72+
-e CARGO_HOME=/home/user/.cargo \
73+
-e PATH=/home/user/.cargo/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
6374
-v "$PWD":/home/user/hostcwd \
75+
-v "$HOME/.rustup":/home/user/.rustup \
76+
-v "$HOME/.cargo":/home/user/.cargo \
6477
-w /home/user/hostcwd \
65-
-e RUST_TOOLCHAIN="$RUST_TOOLCHAIN" \
6678
"$BUILDOZER_IMAGE" \
67-
-lc '
68-
set -euo pipefail
69-
70-
export RUSTUP_HOME="$HOME/.rustup"
71-
export CARGO_HOME="$HOME/.cargo"
72-
export PATH="$CARGO_HOME/bin:$PATH"
73-
74-
apt-get update
75-
apt-get install -y curl
76-
77-
curl https://sh.rustup.rs -sSf \
78-
| sh -s -- -y --profile minimal --default-toolchain "$RUST_TOOLCHAIN"
79-
80-
rustc --version
81-
cargo --version
82-
buildozer android debug
83-
' 2>&1 | tee "$BUILDOZER_BUILD_LOG"
79+
android debug 2>&1 | tee "$BUILDOZER_BUILD_LOG"
8480
8581
- name: Prepare APK artifact
8682
id: artifact

0 commit comments

Comments
 (0)