From 370be86c87cdd5d387cbf6fa192434c041cea839 Mon Sep 17 00:00:00 2001 From: John Oliver <1615532+johnoliver@users.noreply.github.com> Date: Fri, 14 Jun 2024 18:06:56 +0100 Subject: [PATCH] Publish package to github packages --- .github/workflows/java-publish-package.yml | 34 ++++++++++++++++++++++ java/pom.xml | 33 +++++++++++++++++++-- 2 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/java-publish-package.yml diff --git a/.github/workflows/java-publish-package.yml b/.github/workflows/java-publish-package.yml new file mode 100644 index 00000000..3c4b8606 --- /dev/null +++ b/.github/workflows/java-publish-package.yml @@ -0,0 +1,34 @@ +name: Build Java Semantic Kernel + +# Triggers the workflow on merging a PR +on: + pull_request: + types: + - closed + branches: [ "main" ] + paths: + - 'java/**' + +permissions: + contents: read + +jobs: + if_merged: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + - name: Checkout + uses: actions/checkout@v4 + + # Sets up the specified JDK version from the matrix + - uses: actions/setup-java@v4 + with: + java-version: 8 + distribution: microsoft + cache: maven + + # Builds the project with Maven using the matrix JDK version + - name: Build with Maven + run: ./mvnw -B -DskipTests -Pcompile-jdk8 -P-compile-jdk17 -Pgithub-packages clean deploy --file pom.xml + working-directory: java + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/java/pom.xml b/java/pom.xml index 229bb283..d104ce97 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 @@ -663,7 +664,7 @@ // Copyright (c) Microsoft. All rights reserved. - + @@ -762,7 +763,33 @@ ${releaseRepoName} - + + + github-packages + + false + + + + github + GitHub Packages + https://maven.pkg.github.com/microsoft/semantic-kernel-java + + + + + central + https://repo1.maven.org/maven2 + + + github + GitHub Packages + https://maven.pkg.github.com/microsoft/semantic-kernel-java + + true + + +