|
| 1 | +# Copyright 2025 Alibaba Group Holding Ltd. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +name: Publish Java SDKs |
| 16 | + |
| 17 | +on: |
| 18 | + push: |
| 19 | + tags: |
| 20 | + - "java/sandbox/v*" |
| 21 | + - "java/code-interpreter/v*" |
| 22 | + |
| 23 | +permissions: |
| 24 | + contents: read |
| 25 | + |
| 26 | +jobs: |
| 27 | + publish: |
| 28 | + name: Publish (${{ matrix.sdk.name }}) |
| 29 | + if: startsWith(github.ref, format('refs/tags/java/{0}/v', matrix.sdk.tagPrefix)) |
| 30 | + runs-on: ubuntu-latest |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + sdk: |
| 35 | + - name: sandbox |
| 36 | + tagPrefix: sandbox |
| 37 | + workingDirectory: sdks/sandbox/kotlin |
| 38 | + - name: code-interpreter |
| 39 | + tagPrefix: code-interpreter |
| 40 | + workingDirectory: sdks/code-interpreter/kotlin |
| 41 | + steps: |
| 42 | + - name: Checkout code |
| 43 | + uses: actions/checkout@v4 |
| 44 | + |
| 45 | + - name: Set up Java |
| 46 | + uses: actions/setup-java@v4 |
| 47 | + with: |
| 48 | + distribution: temurin |
| 49 | + java-version: "17" |
| 50 | + |
| 51 | + - name: Set up Gradle |
| 52 | + uses: gradle/actions/setup-gradle@v4 |
| 53 | + |
| 54 | + - name: Publish to Maven Central |
| 55 | + working-directory: ${{ matrix.sdk.workingDirectory }} |
| 56 | + env: |
| 57 | + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} |
| 58 | + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }} |
| 59 | + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }} |
| 60 | + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} |
| 61 | + run: | |
| 62 | + ./gradlew publishToMavenCentral |
0 commit comments