Skip to content

Commit 9c1a5b1

Browse files
committed
fix: pin cargo ndk for publish
1 parent 98b6189 commit 9c1a5b1

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/gradle-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424
with:
25-
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.version || github.event.release.tag_name }}
25+
ref: ${{ github.event_name == 'workflow_dispatch' && github.ref_name || github.event.release.tag_name }}
2626
- name: Set up JDK 17
2727
uses: actions/setup-java@v4
2828
with:

bindings/android/lib/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ android {
3939
}
4040
}
4141

42+
packaging {
43+
jniLibs {
44+
keepDebugSymbols += "**/libbitkitcore.so"
45+
}
46+
}
47+
4248
publishing {
4349
singleVariant("release") {
4450
withSourcesJar()

build_android.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,16 @@ cargo build
138138
echo "Building release version..."
139139
cargo build --release
140140

141-
# Install cargo-ndk if not already installed
142-
if ! command -v cargo-ndk &> /dev/null; then
143-
echo "Installing cargo-ndk..."
144-
cargo install cargo-ndk
141+
# Install the cargo-ndk version used by the mobile release scripts.
142+
CARGO_NDK_VERSION="3.5.4"
143+
if ! command -v cargo-ndk &> /dev/null || ! cargo ndk --version | grep -q "cargo-ndk $CARGO_NDK_VERSION"; then
144+
echo "Installing cargo-ndk $CARGO_NDK_VERSION..."
145+
cargo install cargo-ndk --version "$CARGO_NDK_VERSION" --locked --force
146+
fi
147+
148+
CARGO_NDK_NO_STRIP_ARGS=()
149+
if cargo ndk --help 2>&1 | grep -q -- '--no-strip'; then
150+
CARGO_NDK_NO_STRIP_ARGS+=(--no-strip)
145151
fi
146152

147153
# Add Android targets
@@ -156,7 +162,7 @@ rustup target add \
156162
echo "Building for Android architectures..."
157163
cargo ndk \
158164
-o "$JNILIBS_DIR" \
159-
--no-strip \
165+
"${CARGO_NDK_NO_STRIP_ARGS[@]}" \
160166
--manifest-path ./Cargo.toml \
161167
-t armeabi-v7a \
162168
-t arm64-v8a \

0 commit comments

Comments
 (0)