Skip to content

Commit b14aebf

Browse files
authored
Add more android targets to CI and release android artifacts (#593)
* more android Signed-off-by: sagudev <[email protected]> * release android too Signed-off-by: sagudev <[email protected]> * bump to get android releases Signed-off-by: sagudev <[email protected]> --------- Signed-off-by: sagudev <[email protected]>
1 parent 128e1e2 commit b14aebf

File tree

3 files changed

+66
-3
lines changed

3 files changed

+66
-3
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ jobs:
157157

158158
android:
159159
runs-on: ubuntu-latest
160+
strategy:
161+
fail-fast: false
162+
matrix:
163+
target:
164+
[
165+
"armv7-linux-androideabi",
166+
"aarch64-linux-android",
167+
"x86_64-linux-android",
168+
]
160169
steps:
161170
- uses: actions/checkout@v4
162171
- name: Install NDK
@@ -167,12 +176,22 @@ jobs:
167176
- name: Install Rust
168177
uses: dtolnay/rust-toolchain@stable
169178
with:
170-
targets: armv7-linux-androideabi
179+
targets: ${{ matrix.target }}
171180
- name: Build
172181
env:
173182
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
174183
run: |
175-
./android-build cargo build --target="armv7-linux-androideabi"
184+
./android-build cargo build --target="${{ matrix.target }}"
185+
- name: Generate artifact attestation
186+
uses: actions/attest-build-provenance@v1
187+
if: ${{ inputs.release }}
188+
with:
189+
subject-path: "./target/libmozjs-${{ matrix.target }}.tar.gz"
190+
- name: Upload artifact
191+
uses: actions/upload-artifact@v4
192+
with:
193+
path: ./target/libmozjs-${{ matrix.target }}.tar.gz
194+
name: libmozjs-${{ matrix.target }}.tar.gz
176195

177196
ohos:
178197
name: "OpenHarmony"

.github/workflows/release-check.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,50 @@ jobs:
4949
cargo build --verbose
5050
cargo test --tests --examples --verbose
5151
52+
verify-archive-android:
53+
name: "Verify archive Android"
54+
runs-on: ubuntu-latest
55+
strategy:
56+
matrix:
57+
target:
58+
[
59+
"armv7-linux-androideabi",
60+
"aarch64-linux-android",
61+
"x86_64-linux-android",
62+
]
63+
env:
64+
RELEASE_TAG: ${{ github.event_name == 'release' && github.ref_name || inputs.release-tag }}
65+
steps:
66+
- uses: actions/checkout@v4
67+
- name: Install NDK
68+
uses: nttld/setup-ndk@v1
69+
id: setup-ndk
70+
with:
71+
ndk-version: r26c
72+
- name: Install Rust
73+
uses: dtolnay/rust-toolchain@stable
74+
with:
75+
targets: ${{ matrix.target }}
76+
- name: Download prebuilt mozjs from artifact
77+
if: ${{ env.RELEASE_TAG == '' }}
78+
uses: actions/download-artifact@v4
79+
with:
80+
name: libmozjs-${{ matrix.target }}.tar.gz
81+
- name: Build from archive
82+
if: ${{ env.RELEASE_TAG == '' }}
83+
env:
84+
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
85+
MOZJS_ARCHIVE: libmozjs-${{ matrix.target }}.tar.gz
86+
run: |
87+
./android-build cargo build --target="${{ matrix.target }}" --verbose
88+
- name: Build from auto-download (arch ${{ matrix.target }})
89+
if: ${{ env.RELEASE_TAG != '' }}
90+
env:
91+
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
92+
MOZJS_ATTESTATION: strict
93+
run: |
94+
./android-build cargo build --target="${{ matrix.target }}" --verbose
95+
5296
verify-archive-ohos:
5397
name: "Verify archive OpenHarmony"
5498
runs-on: ubuntu-latest

mozjs-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "mozjs_sys"
33
description = "System crate for the Mozilla SpiderMonkey JavaScript engine."
44
repository.workspace = true
5-
version = "0.128.13-0"
5+
version = "0.128.13-1"
66
authors = ["Mozilla"]
77
links = "mozjs"
88
license.workspace = true

0 commit comments

Comments
 (0)