diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b95e607 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,20 @@ +name: Publish release packages +on: + release: + types: [created] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3 + - name: Publish package + uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 + with: + arguments: publish diff --git a/Makefile b/Makefile index 12ff7e6..d98ae21 100644 --- a/Makefile +++ b/Makefile @@ -35,4 +35,7 @@ undeploy: deploy-samples: kubectl apply -f ./deploy/samples +release: + ./gradlew publish + .PHONY: build clean quickstart deploy-dev-environment deploy deploy-samples integration-tests diff --git a/hoptimator-catalog/build.gradle b/hoptimator-catalog/build.gradle index 23a8bcd..9a715e0 100644 --- a/hoptimator-catalog/build.gradle +++ b/hoptimator-catalog/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java-library' id 'idea' + id 'maven-publish' } dependencies { @@ -11,6 +12,25 @@ dependencies { testImplementation libs.assertj } +publishing { + repositories { + maven { + url = "https://maven.pkg.github.com/linkedin/Hoptimator" + credentials { + username = System.getenv('GITHUB_ACTOR') + password = System.getenv('GITHUB_TOKEN') + } + } + } + publications { + maven(MavenPublication) { + groupId = 'com.linkedin.hoptimator' + artifactId = 'hoptimator-catalog' + from components.java + } + } +} + tasks.withType(JavaCompile) { options.compilerArgs << '-Xlint:deprecation' options.compilerArgs << '-Xlint:unchecked' diff --git a/hoptimator-planner/build.gradle b/hoptimator-planner/build.gradle index 0b73b1b..074fb34 100644 --- a/hoptimator-planner/build.gradle +++ b/hoptimator-planner/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java-library' id 'idea' + id 'maven-publish' } dependencies { @@ -10,6 +11,25 @@ dependencies { api libs.calciteCore } +publishing { + repositories { + maven { + url = "https://maven.pkg.github.com/linkedin/Hoptimator" + credentials { + username = System.getenv('GITHUB_ACTOR') + password = System.getenv('GITHUB_TOKEN') + } + } + } + publications { + maven(MavenPublication) { + groupId = 'com.linkedin.hoptimator' + artifactId = 'hoptimator-planner' + from components.java + } + } +} + tasks.withType(JavaCompile) { options.compilerArgs << '-Xlint:deprecation' options.compilerArgs << '-Xlint:unchecked'