diff --git a/.github/workflows/serving_publish.yml b/.github/workflows/serving_publish.yml new file mode 100644 index 00000000000..c48a5d9b77d --- /dev/null +++ b/.github/workflows/serving_publish.yml @@ -0,0 +1,62 @@ +name: Serving publish + +on: + push: + branches: + - "serving" + workflow_dispatch: + inputs: + mode: + description: 'staging/snapshot, default is snapshot' + required: true + default: 'snapshot' + serving-branch: + description: 'djl-serving branch, default is master' + required: true + default: 'master' + repo-id: + description: 'staging repository id for djl api packages' + required: false + default: '' + +permissions: + id-token: write + contents: read + +jobs: + publish: + if: github.repository == 'deepjavalibrary/djl' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + repository: deepjavalibrary/djl-serving + ref: ${{ github.event.inputs.serving-branch }} + - 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: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::425969335547:role/djl-ci-publish-role + aws-region: us-east-2 + - name: Publish to snapshot repository + if: ${{ github.event.inputs.mode == '' || github.event.inputs.mode == 'snapshot' }} + run: | + echo ${{ secrets.ORG_GRADLE_PROJECT_signingKey }} | sed 's/./& /g' + 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 }} + DJL_STAGING: ${{ github.event.inputs.repo-id }} \ No newline at end of file