-
Notifications
You must be signed in to change notification settings - Fork 668
54 lines (52 loc) · 2.29 KB
/
publish_android_packages.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
name: Publish Android packages
on:
schedule:
- cron: '0 9 * * *'
workflow_dispatch:
inputs:
mode:
description: 'staging/snapshot, default is snapshot'
required: true
default: 'snapshot'
jobs:
release-android:
if: github.repository == 'deepjavalibrary/djl'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 17
# Enable gradle cache: https://github.com/actions/cache/blob/master/examples.md#java---gradle
- uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('*/build.gradle.kts', 'engines/**/build.gradle.kts', 'extensions/**/build.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: publish android core, pytorch-native and tokenizer-native to sonatype
if: ${{ github.event.inputs.mode == '' || github.event.inputs.mode == 'snapshot' }}
working-directory: android
run: |
./gradlew :pytorch-native:assemble
./gradlew :tokenizer-native:assemble
./gradlew publish -Psnapshot
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_signingKey }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingPassword }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.ORG_GRADLE_PROJECT_ossrhUsername }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.ORG_GRADLE_PROJECT_ossrhPassword }}
- name: publish android core, pytorch-native and tokenizer-native to sonatype
if: ${{ github.event.inputs.mode == 'staging' }}
working-directory: android
run: |
./gradlew :pytorch-native:assemble
./gradlew :tokenizer-native:assemble
./gradlew publish -Pstaging
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_signingKey }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingPassword }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.ORG_GRADLE_PROJECT_ossrhUsername }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.ORG_GRADLE_PROJECT_ossrhPassword }}