From 72c9fdb9c079b5223d5bf04c3f19e2a568fb28a2 Mon Sep 17 00:00:00 2001 From: Lawrence Liu Date: Thu, 25 Jun 2020 07:26:23 +0800 Subject: [PATCH 1/3] Fixes https://github.com/puneetbehl/elasticsearch-grails-plugin/issues/47 Use class name instead of domain name to fix #47 Fixes https://github.com/puneetbehl/elasticsearch-grails-plugin/issues/47 --- .../plugins/elasticsearch/mapping/SearchableClassMapping.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/grails/plugins/elasticsearch/mapping/SearchableClassMapping.groovy b/src/main/groovy/grails/plugins/elasticsearch/mapping/SearchableClassMapping.groovy index 95d521f3..6600b7de 100644 --- a/src/main/groovy/grails/plugins/elasticsearch/mapping/SearchableClassMapping.groovy +++ b/src/main/groovy/grails/plugins/elasticsearch/mapping/SearchableClassMapping.groovy @@ -84,7 +84,7 @@ class SearchableClassMapping implements ElasticSearchConfigAware { } String calculateIndexName() { - String name = (esConfig?.get('index') as ConfigObject)?.name ?: domainClass.packageName + String name = (esConfig?.get('index') as ConfigObject)?.name ?: domainClass.getClass().getName() if (name == null || name.length() == 0) { name = domainClass.defaultPropertyName From 8edd3da2064ade2f2b6826d493a10935fed94d8f Mon Sep 17 00:00:00 2001 From: Lawrence Liu Date: Thu, 25 Jun 2020 07:35:59 +0800 Subject: [PATCH 2/3] Add release to maven repo (#1) * Create gradle.yml * Update gradle.yml * Add release to maven repo. * Fix releasing. --- .github/workflows/gradle.yml | 20 ++++++++++++++++++++ .github/workflows/publish-release.yml | 26 ++++++++++++++++++++++++++ build.gradle | 21 +++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 .github/workflows/gradle.yml create mode 100644 .github/workflows/publish-release.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 00000000..048e9620 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,20 @@ +# Gradle build and deploy to github maven package. + +# Gradle build. + +name: Java Build + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Build with Gradle + run: ./gradlew build test diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 00000000..40f1dbc9 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,26 @@ +# publish-release.yml +# https://medium.com/@shanemyrick/publishing-to-github-packages-with-gradle-and-github-actions-4ad842634c4e + +name: Publish release + +on: [push] + +jobs: + publish-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout latest code + uses: actions/checkout@v1 + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Publish artifact + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + run: | + ./gradlew publish diff --git a/build.gradle b/build.gradle index 3b45a50c..59a06698 100644 --- a/build.gradle +++ b/build.gradle @@ -155,6 +155,27 @@ bootRun { // enable if you wish to package this plugin as a standalone application bootJar.enabled = false + +publishing { + + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/muyantech/elasticsearch-grails-plugin") + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } + + publications { + gpr(MavenPublication) { + from(components.java) + } + } +} + apply from: "gradle/documentation.gradle" apply from: "gradle/publish.gradle" From a6b524f9acf6c61a17d994868027e03b175abf79 Mon Sep 17 00:00:00 2001 From: Liu Xiang Qian Date: Thu, 25 Jun 2020 08:02:38 +0800 Subject: [PATCH 3/3] Upgrade to 3.0.1.BUILD-SNAPSHOT --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 59a06698..ff53192a 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ plugins { id "de.undercouch.download" version "3.2.0" } -version "3.0.0.BUILD-SNAPSHOT" +version "3.0.1.BUILD-SNAPSHOT" group "org.grails.plugins" apply plugin: 'eclipse'