-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
2 changed files
with
126 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
name: Development CI | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
env: | ||
OPENCV_VERSION: 4.7.0 | ||
NDK_VERSION: 23.1.7779620 | ||
IS_ACTIONS: 1 | ||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | ||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | ||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup tag info | ||
run: | | ||
GIT_TAG=${GITHUB_REF#refs/*/} | ||
echo "GIT_TAG=${GIT_TAG}" >> $GITHUB_ENV | ||
- uses: actions/checkout@v3 | ||
|
||
- name: set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Cache OpenCV4Android SDK | ||
id: cache-opencv | ||
uses: actions/cache@v2 | ||
with: | ||
path: ./opencv | ||
key: ${{ runner.os }}-opencv-for-android-${{ env.OPENCV_VERSION }} | ||
restore-keys: | | ||
${{ runner.os }}-opencv-for-android- | ||
- if: ${{ steps.cache-opencv.outputs.cache-hit != 'true' }} | ||
name: Download OpenCV4Android and extract to :opencv | ||
run: | | ||
wget https://github.com/opencv/opencv/releases/download/$OPENCV_VERSION/opencv-$OPENCV_VERSION-android-sdk.zip -O opencv.zip | ||
unzip opencv.zip OpenCV-android-sdk/sdk/* -d extracted-opencv | ||
mv extracted-opencv/OpenCV-android-sdk/sdk opencv | ||
rm -rf extracted-opencv opencv.zip | ||
- name: Copy opencv.build.gradle.txt to opencv/build.gradle | ||
run: cp opencv.build.gradle.txt opencv/build.gradle | ||
|
||
- name: Cache NDK | ||
id: cache-ndk | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.ANDROID_SDK_ROOT }}/ndk/${{ env.NDK_VERSION }} | ||
key: ${{ runner.os }}-ndk-${{ env.NDK_VERSION }} | ||
restore-keys: | | ||
${{ runner.os }}-ndk- | ||
- if: ${{ steps.cache-ndk.outputs.cache-hit != 'true' }} | ||
name: Install NDK | ||
run: | | ||
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;23.1.7779620" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null | ||
# - name: Extract keystore to $KEYSTORE_FILENAME before ensure the parent directory exists | ||
# run: | | ||
# mkdir -p $(dirname $KEYSTORE_FILENAME) | ||
# echo $KEYSTORE_CONTENT | base64 --decode > $KEYSTORE_FILENAME | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Gradle Build | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
arguments: assembleRelease | ||
# | ||
# - name: Build with Gradle | ||
# run: ./gradlew build | ||
- name: List APKs | ||
run: find ./ -name "*.apk" | ||
|
||
- name: Update ARM64 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: arm64-v8a-${{ github.sha }} | ||
path: app/build/outputs/apk/release/app-arm64-v8a-release.apk | ||
|
||
- name: Update x86_64 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: x86_64-${{ github.sha }} | ||
path: app/build/outputs/apk/release/app-x86_64-release.apk | ||
|
||
- name: Update ARM32 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: armeabi-v7a-${{ github.sha }} | ||
path: app/build/outputs/apk/release/app-armeabi-v7a-release.apk | ||
|
||
- name: Update x86 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: x86-${{ github.sha }} | ||
path: app/build/outputs/apk/release/app-x86-release.apk | ||
|
||
- name: Update mapping | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: mapping-${{ github.sha }} | ||
path: app/build/outputs/mapping/release/mapping.txt | ||
retention-days: 5 | ||
|
||
- name: Upload image to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: 'app/build/outputs/apk/release/*.apk' | ||
file_glob: true | ||
tag: ${{ env.GIT_TAG }} | ||
overwrite: true |