-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d197ba
commit 8ff0fcf
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |