Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: build apk in the nightly job #4852

Merged
merged 8 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -503,16 +503,13 @@ jobs:
target: aarch64-linux-android

- name: Build todo demo
run: |
sed -i "s/#wasm# //" Cargo.toml
cargo apk build -p todo --target aarch64-linux-android --lib
working-directory: examples/todo/rust
run: cargo apk build -p todo --target aarch64-linux-android --lib

- name: Build energy-monitor example
run: cargo apk build -p energy-monitor --target aarch64-linux-android --lib

- name: Build printerdemo example
run: |
sed -i "s/#wasm# //" Cargo.toml
cargo apk build -p printerdemo --target aarch64-linux-android --lib
working-directory: examples/printerdemo/rust
run: cargo apk build -p printerdemo --target aarch64-linux-android --lib

miri:
runs-on: ubuntu-latest
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/nightly_snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,49 @@ jobs:
tag: v${{ steps.version.outputs.VERSION }}
commit: ${{ github.sha }}

android:
env:
CARGO_APK_RELEASE_KEYSTORE: /home/runner/.android/release.keystore
CARGO_APK_RELEASE_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Android API level 30
run: ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "platforms;android-30"
- name: Cache cargo-apk
id: cargo-apk-cache
uses: actions/cache@v4
with:
path: ~/.cargo/bin/cargo-apk
key: cargo-apk-cache
# Only build cargo-apk if not cached
- uses: dtolnay/rust-toolchain@stable
if: steps.cargo-apk-cache.outputs.cache-hit != 'true'
- name: Install cargo-apk
if: steps.cargo-apk-cache.outputs.cache-hit != 'true'
run: cargo install cargo-apk

- uses: ./.github/actions/setup-rust
with:
target: aarch64-linux-android

- name: dump keystore
run: |
mkdir -p /home/runner/.android
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > $CARGO_APK_RELEASE_KEYSTORE

- name: Build energy-monitor example
run: cargo apk build -p energy-monitor --target aarch64-linux-android --lib --release
- name: Build todo demo
run: cargo apk build -p todo --target aarch64-linux-android --lib --release
- name: "upload APK artifact"
uses: actions/upload-artifact@v4
with:
name: android-demo
path: |
target/release/apk/energy-monitor.apk
target/release/apk/todo_lib.apk

# Purely quality-assurance related jobs, not relevant for release artefacts
qa-esp-idf:
strategy:
Expand Down
3 changes: 0 additions & 3 deletions examples/energy-monitor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ build = "build.rs"
publish = false
license = "MIT"

[[bin]]
name = "energy-monitor"

[lib]
crate-type = ["cdylib", "lib"]

Expand Down
Loading