Skip to content

Commit

Permalink
Merge pull request #48 from Stremio/feat/improve-imports-and-exports
Browse files Browse the repository at this point in the history
Feat: Improve imports and exports
  • Loading branch information
elpiel authored Oct 25, 2024
2 parents 818bfdb + 9baf392 commit 7ca0ae9
Show file tree
Hide file tree
Showing 107 changed files with 2,675 additions and 2,205 deletions.
11 changes: 11 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[env]
# Make sure to keep this version in line with the `.github/workflows/release.yml`
# action for releaseing stremio-core-kotlin!
NDK_VERSION = "27.2.12479018"

# Set the same RANLIB binary location for all the 4 targets:
# armv7-linux-androideabi, aarch64-linux-android, i686-linux-android, x86_64-linux-android
RANLIB_armv7_linux_androideabi = "$$ANDROID_HOME/ndk/$$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib"
RANLIB_aarch64_linux_android = "$$ANDROID_HOME/ndk/$$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib"
RANLIB_i686_linux_android = "$$ANDROID_HOME/ndk/$$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib"
RANLIB_x86_64_linux_android = "$$ANDROID_HOME/ndk/$$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib"
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
# Check for outdated actions
updates:
- package-ecosystem: "github-actions"
directory: "/"
# Check for updates every Monday
schedule:
interval: "weekly"
39 changes: 31 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,46 @@ on:
branches:
- '**'

# Stops the running workflow of previous pushes
concurrency:
group: ${{ github.ref }}-android
cancel-in-progress: true

env:
# For the confusing protoc versioning check out these docs:
# https://protobuf.dev/support/version-support/
# v3.26.x, where `.x` is a wildcard
#
# For stremio-core-android we use version 3.21
# Check build.gradle.kts
PROTOC_VERSION: '21.x'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set default rust toolchain
run: rustup default 1.67.1
- name: Install rustfmt
run: rustup component add rustfmt
- name: Install clippy
run: rustup component add clippy
uses: actions/checkout@v4

# add protoc because of stremio-core-csharp
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "${{ env.PROTOC_VERSION }}"

- name: Rust setup (1.70.0)
uses: dtolnay/rust-toolchain@1.70.0
with:
components: rustfmt, clippy

- name: Rust cache
uses: Swatinem/rust-cache@v2

- name: Build code
run: cargo build
run: cargo build -p stremio-core-android

- name: Lint code format
run: cargo fmt --all -- --check

- name: Lint code
run: cargo clippy --all -- -D warnings
48 changes: 27 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@
name: Release
name: Release stremio-core-android

on:
release:
types: [published]

env:
# Make sure to keep this version in line with `.config/cargo.toml` file for
# stremio-core-kotlin!
NDK_VERSION: '27.2.12479018'

jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "adopt"
- name: Setup Android SDK
# newer version of the 2 actions will cause a LinkageError
# Error: LinkageError occurred while loading main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
# java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/sdkmanager/SdkManagerCli
# has been compiled by a more recent version of the Java Runtime (class file version 61.0),
# this version of the Java Runtime only recognizes class file versions up to 55.0
# uses: android-actions/setup-android@v3
uses: android-actions/setup-android@v2
- name: Setup Android NDK
run: yes | sdkmanager "ndk;21.4.7075529" >/dev/null
- name: Set default rust toolchain
run: rustup default 1.67.1
- name: Install rustfmt
run: rustup component add rustfmt
- name: Install clippy
run: rustup component add clippy
- name: Add armv7 target
run: rustup target add armv7-linux-androideabi
- name: Add aarch64 target
run: rustup target add aarch64-linux-android
- name: Add i686 target
run: rustup target add i686-linux-android
- name: Add x86_64 target
run: rustup target add x86_64-linux-android
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Setup Android NDK (${{ env.NDK_VERSION }})
run: yes | sdkmanager "ndk;${{ env.NDK_VERSION }}" >/dev/null

# use MSRV
- name: Set Rust version to MSRV 1.70
uses: dtolnay/rust-toolchain@1.70
with:
# Add armv7, aarch64, i686, x86_64 targets
targets: armv7-linux-androideabi, aarch64-linux-android, i686-linux-android, x86_64-linux-android
components: rust-std

- uses: Swatinem/rust-cache@v2

- name: Build aar
run: ./gradlew -Pversion=${GITHUB_REF##*/} publishToMavenLocal
- name: Archive artifacts
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
/.gradle
/src/debug
/src/release
/**/rust/protobuf/*
!/**/rust/protobuf/README.md
/.idea/
/local.properties

/stremio-core-protobuf/src/protobuf/*
!/stremio-core-protobuf/src/protobuf/README.md
Loading

0 comments on commit 7ca0ae9

Please sign in to comment.