Skip to content

Merge pull request #24 from ninan-nn/ci/publish_java_sdk_workflow #1

Merge pull request #24 from ninan-nn/ci/publish_java_sdk_workflow

Merge pull request #24 from ninan-nn/ci/publish_java_sdk_workflow #1

# Copyright 2025 Alibaba Group Holding Ltd.

Check failure on line 1 in .github/workflows/publish-java-sdks.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish-java-sdks.yml

Invalid workflow file

(Line: 29, Col: 9): Unrecognized named-value: 'matrix'. Located at position 55 within expression: startsWith(github.ref, format('refs/tags/java/{0}/v', matrix.sdk.tagPrefix))
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Publish Java SDKs
on:
push:
tags:
- "java/sandbox/v*"
- "java/code-interpreter/v*"
permissions:
contents: read
jobs:
publish:
name: Publish (${{ matrix.sdk.name }})
if: startsWith(github.ref, format('refs/tags/java/{0}/v', matrix.sdk.tagPrefix))
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk:
- name: sandbox
tagPrefix: sandbox
workingDirectory: sdks/sandbox/kotlin
- name: code-interpreter
tagPrefix: code-interpreter
workingDirectory: sdks/code-interpreter/kotlin
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Publish to Maven Central
working-directory: ${{ matrix.sdk.workingDirectory }}
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }}
run: |
./gradlew publishToMavenCentral