forked from deepjavalibrary/djl
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (54 loc) · 1.86 KB
/
native_jni_s3_pytorch_android.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Native JNI S3 PyTorch Android
on:
workflow_dispatch:
jobs:
build-pytorch-jni-android:
if: github.repository == 'awslabs/djl'
runs-on: ubuntu-18.04
env:
NDK_VERSION: "20.0.5594570"
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install NDK
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;${NDK_VERSION}"
- name: build android
run: |
export ANDROID_NDK=${ANDROID_SDK_ROOT}/ndk/${NDK_VERSION}
./gradlew :pytorch:pytorch-native:compileAndroidJNI
- name: Upload compiled jni library
uses: actions/upload-artifact@v1
if: always()
with:
name: jnilib-Android
path: pytorch/pytorch-native/jnilib
publish:
if: github.repository == 'awslabs/djl'
runs-on: ubuntu-18.04
needs: [build-pytorch-jni-android]
steps:
- uses: actions/checkout@v2
- name: Download compiledJNI Android
uses: actions/download-artifact@v1
with:
name: jnilib-Android
path: jnilib
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Copy files to S3 with the AWS CLI
run: |
aws s3 sync jnilib s3://djl-ai/publish/pytorch-1.7.1/jnilib
aws cloudfront create-invalidation --distribution-id E371VB8JQ6NRVY --paths "/pytorch-1.7.1/jnilib*"