-
Notifications
You must be signed in to change notification settings - Fork 621
87 lines (84 loc) · 2.9 KB
/
native_s3_dlr.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Native S3 DLR
on:
workflow_dispatch:
jobs:
build-osx:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Get DLR_VERSION
run: |
DLR_VERSION="$(cat gradle.properties | awk -F '=' '/dlr_version/ {print $2}')"
echo "DLR_VERSION=${DLR_VERSION}" >> $GITHUB_ENV
- name: Checkout DLR repo
uses: actions/checkout@v2
with:
repository: neo-ai/neo-ai-dlr
ref: v${{ env.DLR_VERSION }}
path: neo-ai-dlr
submodules: 'recursive'
- name: Build package
# avoid g++ to compile the native, use system-default clang++ instead
run: |
cd neo-ai-dlr
mkdir build
cd build
cmake ..
cmake --build . --config Release -- -j8
- 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: Upload native DJL to S3
run: aws s3 cp *dlr.* s3://djl-ai/publish/dlr-${{ env.DLR_VERSION }}/native/osx/cpu/
working-directory: engines/neo-ai-dlr/build/lib
build-linux:
runs-on: ubuntu-latest
container: amazonlinux:2
steps:
- name: Install Environment
run: |
yum -y update
yum -y groupinstall "Development Tools"
yum -y install patch cmake3
ln -sf /usr/bin/cmake3 /usr/bin/cmake
pip3 install awscli --upgrade
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Get DLR_VERSION
run: |
DLR_VERSION="$(cat gradle.properties | awk -F '=' '/dlr_version/ {print $2}')"
echo "DLR_VERSION=${DLR_VERSION}" >> $GITHUB_ENV
- name: Checkout DLR repo
uses: actions/checkout@v2
with:
repository: neo-ai/neo-ai-dlr
ref: v${{ env.DLR_VERSION }}
path: neo-ai-dlr
submodules: 'recursive'
- name: Build package
# avoid g++ to compile the native, use system-default clang++ instead
run: |
cd neo-ai-dlr
mkdir build
cd build
cmake ..
cmake --build . --config Release -- -j8
- 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: Upload native DJL to S3
run: aws s3 cp *dlr.* s3://djl-ai/publish/dlr-${DLR_VERSION}/native/linux/cpu/
working-directory: engines/neo-ai-dlr/build/lib