From fda84a2c3bebb47acb2ad61c3878727bae22bf59 Mon Sep 17 00:00:00 2001 From: Pavlo Fedyna Date: Mon, 27 Nov 2023 15:48:13 +0100 Subject: [PATCH] [build] add querqy-unplugged jar build GA --- .github/workflows/pipeline.yaml | 51 +++++++++++++++++++++++++++++++ gradle/repositoriesGitHub.gradle | 52 ++++++++++++++++++++++++++++++++ library/build.gradle | 9 ++++++ 3 files changed, 112 insertions(+) create mode 100644 .github/workflows/pipeline.yaml create mode 100644 gradle/repositoriesGitHub.gradle diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml new file mode 100644 index 0000000..22e16a5 --- /dev/null +++ b/.github/workflows/pipeline.yaml @@ -0,0 +1,51 @@ +name: 'querqy-unplugged' +on: + push: + branches: + - main +env: + SERVICE_NAME: querqy-unplugged + JDK_VERSION: 11 + +permissions: + id-token: write + contents: read # This is required for actions/checkout + statuses: write + checks: write + +jobs: + build-from-script: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: setup java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' # See 'Supported distributions' for available options + java-version: '${{ inputs.jdk }}' + + - name: ECR Login + uses: aws-actions/amazon-ecr-login@v1 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2.9.0 + with: + gradle-version: ${{ env.JDK_VERSION }} + + - name: run tests + run: ./gradlew --refresh-dependencies check + + - name: jar + run: ./gradlew :library:clean :library:assemble :library:testClasses :library:jar + + - name: test report + uses: dorny/test-reporter@v1 + if: always() # run this step even if previous step failed + with: + name: test report # Name of the check run which will be created + path: build/test-results/**/TEST-*.xml # Path to test results + reporter: java-junit diff --git a/gradle/repositoriesGitHub.gradle b/gradle/repositoriesGitHub.gradle new file mode 100644 index 0000000..76b899e --- /dev/null +++ b/gradle/repositoriesGitHub.gradle @@ -0,0 +1,52 @@ +/** + * ( + * ( ( ( ( )\ ) + * ( )\ ( )\))( ' )\ (()/( ( + * )((_) )\ ((_)()\ )((((_)( /(_)))\ + * ((_)_ ((_) _(())\_)())\ _ )\ (_)) ((_) + * | _ )| __|\ \((_)/ /(_)_\(_)| _ \| __| + * | _ \| _| \ \/\/ / / _ \ | /| _| + * |___/|___| \_/\_/ /_/ \_\ |_|_\|___| + * + This file is a copy from the pipeline-scripts project (git@github.com:otto-ec/search_pipeline-scripts.git) + It will be overwritten every night by the source from the pipeline-scripts. + If you want to make changes to it that should be available globally, change it in the pipeline-scripts repo. + If you have a change unique to this project consider putting the information elsewhere. + */ +apply plugin: 'maven-publish' + +allprojects { + repositories { + // mavenLocal() uncomment to + mavenCentral() + maven { + name "GitHub" + url "https://maven.pkg.github.com/otto-de/querqy-unplugged" + credentials { + username = project.findProperty("gpr.user") ?: System.getenv("FKT_USER") + password = project.findProperty("gpr.key") ?: System.getenv("FKT_KEY") + } + } + flatDir { + dirs "libs" + } + } +} + +publishing { + repositories { + maven { + name "Github" + url "https://maven.pkg.github.com/otto-ec/nucleus_libs" + credentials { + username = project.findProperty("gpr.user") ?: System.getenv("FKT_USER") + password = project.findProperty("gpr.key") ?: System.getenv("FKT_KEY") + } + } + } + publications { + gpr(MavenPublication) { + from(components.java) + } + } +} diff --git a/library/build.gradle b/library/build.gradle index fca7444..82bbbb8 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -4,6 +4,8 @@ plugins { id 'signing' } +apply from: '../gradle/repositoriesGitHub.gradle' + repositories { mavenCentral() } @@ -13,6 +15,7 @@ allprojects { version = '1.0.1-SNAPSHOT' } + ext { querqyCoreVersion = '3.15.0' elasticsearchVersion = '7.17.8' @@ -100,6 +103,12 @@ publishing { } } } + +jar { + archiveBaseName = "${rootProject.name}" + archiveVersion = "${project.version}" +} + /* signing { def signingKey = findProperty("signingKey")