Nightly Publish #2139
This file contains hidden or 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
name: Nightly Publish | |
on: | |
schedule: | |
- cron: '0 10 * * *' | |
workflow_dispatch: | |
inputs: | |
mode: | |
description: 'staging/snapshot, default is snapshot' | |
required: true | |
default: 'snapshot' | |
jobs: | |
build: | |
if: github.repository == 'deepjavalibrary/djl' | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
fail-fast: false | |
matrix: | |
operating-system: [ macos-latest, ubuntu-latest, ubuntu-24.04-arm, windows-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
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: check disk space | |
run: df -h | |
- name: install libomp on macos | |
if: ${{ runner.os == 'macOS' }} | |
run: brew install libomp | |
- name: Build with Gradle | |
run: ./gradlew -Dnightly=true build :jacoco:testCodeCoverageReport | |
- name: PyTorch integration test | |
run: ./gradlew :integration:clean :integration:test "-Dai.djl.default_engine=PyTorch" | |
- name: TensorFlow integration test | |
run: ./gradlew :integration:clean :integration:test "-Dai.djl.default_engine=TensorFlow" | |
- name: OnnxRuntime integration test | |
run: ./gradlew :integration:clean :integration:test "-Dai.djl.default_engine=OnnxRuntime" | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: reports-${{ matrix.operating-system }} | |
path: | | |
${{ github.workspace }}/**/build/reports/**/* | |
!${{ github.workspace }}/**/build/reports/jacoco/* | |
publish: | |
if: github.repository == 'deepjavalibrary/djl' | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
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 to snapshot repository | |
if: ${{ github.event.inputs.mode == '' || github.event.inputs.mode == 'snapshot' }} | |
# PT 1.13.1 is for PT 1.x support, and CUDA 11.x support | |
# PT 2.5.1 is for CUDA 12.4 support | |
run: | | |
./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=1.13.1 -Psnapshot | |
./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=2.5.1 -Psnapshot | |
./gradlew clean engines:ml:xgboost:publish -Pgpu -Psnapshot | |
./gradlew clean publish -Psnapshot | |
cd bom | |
./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_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_sonatypeUsername }} | |
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_sonatypePassword }} | |
- name: Publish to staging repository | |
if: ${{ github.event.inputs.mode == 'staging' }} | |
run: | | |
./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=1.13.1 -P${{ github.event.inputs.mode }} | |
./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=2.5.1 -P${{ github.event.inputs.mode }} | |
./gradlew clean engines:ml:xgboost:publish -Pgpu -P${{ github.event.inputs.mode }} | |
./gradlew clean publish -P${{ github.event.inputs.mode }} | |
cd bom | |
./gradlew publish -P${{ github.event.inputs.mode }} | |
env: | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_signingKey }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingPassword }} | |
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_sonatypeUsername }} | |
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_sonatypePassword }} |