Skip to content

Commit

Permalink
Merge pull request #62 from johnoliver/package
Browse files Browse the repository at this point in the history
Publish package to github packages
  • Loading branch information
johnoliver authored Jun 14, 2024
2 parents d73382e + ae9bb04 commit 6c972f3
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 3 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/java-publish-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy Java Semantic Kernel Package

# 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 }}
33 changes: 30 additions & 3 deletions java/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -663,7 +664,7 @@
<licenseHeader>
<content>// Copyright (c) Microsoft. All rights reserved.</content>
</licenseHeader>
<toggleOffOn />
<toggleOffOn/>
</java>
</configuration>
</plugin>
Expand Down Expand Up @@ -762,7 +763,33 @@
<name>${releaseRepoName}</name>
</repository>
</distributionManagement>

</profile>
<profile>
<id>github-packages</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/microsoft/semantic-kernel-java</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/microsoft/semantic-kernel-java</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>

Expand Down

0 comments on commit 6c972f3

Please sign in to comment.