diff --git a/.github/workflows/maven-sdk.yml b/.github/workflows/maven-sdk.yml index 8f5d6a018..d4f6e153e 100644 --- a/.github/workflows/maven-sdk.yml +++ b/.github/workflows/maven-sdk.yml @@ -28,6 +28,10 @@ jobs: os: ubuntu-latest container: quay.io/pypa/manylinux_2_28_x86_64@sha256:441c35fdc6ee809ff9260894f8468ab4fea8c15dc880f8700a3f81b7922c1cda resource-prefix: linux-x86-64 + - name: linux-aarch64 + os: ubuntu-22.04-arm + container: quay.io/pypa/manylinux_2_28_aarch64@sha256:8b5f2b4e8c072ae5aefeb659f22c03e1ff46e6a82f154b6c904b106c87e65ff7 + resource-prefix: linux-aarch64 - name: win32-x86-64 os: windows-latest resource-prefix: win32-x86-64 @@ -122,9 +126,54 @@ jobs: path: maven-artifacts/** if-no-files-found: error + smoke-test-linux-aarch64: + name: Smoke test Kotlin GDK (linux-aarch64) + needs: package + runs-on: ubuntu-22.04-arm + steps: + - name: Checkout code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + + - name: Set up Java + uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 + with: + distribution: temurin + java-version: "17" + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 + + - name: Download Maven artifact bundle + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + with: + name: goose-sdk-maven + path: maven-artifacts + + - name: Install Maven artifact bundle into local repository + shell: bash + run: | + version=$(grep -m1 '^version =' crates/goose-sdk/Cargo.toml | sed -E 's/version = "([^"]+)"/\1/') + target="$HOME/.m2/repository/io/github/aaif-goose/gdk/$version" + mkdir -p "$target" + find maven-artifacts -type f -exec cp {} "$target/" + + + - name: Load native library in an ARM64 JVM + shell: bash + working-directory: crates/goose-sdk/examples/uniffi/kotlin + run: | + gradle --no-daemon installDist + cat > "$RUNNER_TEMP/LoadNativeLibrary.java" <<'JAVA' + public class LoadNativeLibrary { + public static void main(String[] args) { + System.out.println(io.github.aaif_goose.GooseKt.openaiDefaultModel()); + } + } + JAVA + java -cp "$(find build/install -name '*.jar' | paste -sd: -)" "$RUNNER_TEMP/LoadNativeLibrary.java" + publish: name: Publish to Maven Central - needs: package + needs: [package, smoke-test-linux-aarch64] runs-on: ubuntu-latest if: github.event_name == 'workflow_dispatch' && inputs.publish environment: maven-central