From 786a7173c2dd1c54e7b66d25bd680901c95f5597 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Thu, 22 Aug 2024 14:26:03 +0100 Subject: [PATCH 1/6] fix: java 8 incompatibility (#165) * Re-add java 8 to test matrix * Replace Map.entry() * Formatting --- .github/workflows/run-tests.yml | 2 +- src/main/java/com/flagsmith/utils/ModelUtils.java | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 4399b06..f3af111 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - java: [ "11", "17", "21" ] + java: [ "8", "11", "17", "21" ] distribution: [ "zulu", "adopt" ] steps: diff --git a/src/main/java/com/flagsmith/utils/ModelUtils.java b/src/main/java/com/flagsmith/utils/ModelUtils.java index 4fad2d2..7128d38 100644 --- a/src/main/java/com/flagsmith/utils/ModelUtils.java +++ b/src/main/java/com/flagsmith/utils/ModelUtils.java @@ -3,6 +3,7 @@ import com.flagsmith.flagengine.identities.traits.TraitModel; import com.flagsmith.models.SdkTraitModel; import com.flagsmith.models.TraitConfig; +import java.util.AbstractMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -46,12 +47,8 @@ private static Stream> getTraitConfigStreamFromTraitM Map traits ) { return traits.entrySet().stream().map( - (row) -> { - return Map.entry( - row.getKey(), - TraitConfig.fromObject(row.getValue()) - ); - } + row -> new AbstractMap.SimpleEntry<>( + row.getKey(), TraitConfig.fromObject(row.getValue())) ); } From 5a0ab8a06b1e159eb15fca9102b616e18191a9e1 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Thu, 22 Aug 2024 14:54:28 +0100 Subject: [PATCH 2/6] Bump version 7.4.1 (#166) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 356d458..921c1fd 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.flagsmith flagsmith-java-client - 7.4.0 + 7.4.1 jar Flagsmith Java Client From d869412f92fca8647f8a67150f03781c21e2406f Mon Sep 17 00:00:00 2001 From: madgaet Date: Fri, 13 Sep 2024 10:04:08 +0200 Subject: [PATCH 3/6] fix: Change visibilty of Protocol (#167) Modify default visibility to public so it can used correctly. --- src/main/java/com/flagsmith/config/FlagsmithConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/flagsmith/config/FlagsmithConfig.java b/src/main/java/com/flagsmith/config/FlagsmithConfig.java index e822d48..e2ea1a8 100644 --- a/src/main/java/com/flagsmith/config/FlagsmithConfig.java +++ b/src/main/java/com/flagsmith/config/FlagsmithConfig.java @@ -292,7 +292,7 @@ public FlagsmithConfig build() { } // This enum prevents leakage of the underlying HTTP client implementation details. - enum Protocol { + public enum Protocol { HTTP_1_1(okhttp3.Protocol.HTTP_1_1), HTTP_2(okhttp3.Protocol.HTTP_2); From 288fe83def18b030fe4bdf02056f33bdf20fb4c3 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Fri, 13 Sep 2024 09:12:43 +0100 Subject: [PATCH 4/6] Bump version 7.4.2 (#168) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 921c1fd..3c2a68c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.flagsmith flagsmith-java-client - 7.4.1 + 7.4.2 jar Flagsmith Java Client From 07a5940c333a6362177630ba4227cecd24f98370 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 9 Dec 2024 16:42:26 +0000 Subject: [PATCH 5/6] ci: publish workflow (#169) * Add central publishing package * Add publish workflow * Add current branch to workflow * fix syntax * Add runs-on and name * Add checkout and setup java * Add skip tests * Remove skipTests and checkout submodules * Play around with more vars to set up java * Bump version * Add profile * Revert changes to pom.xml * Remove branch from publish workflow --- .github/workflows/publish.yml | 45 +++++++++++++++++++++++++++++++++++ pom.xml | 10 ++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..96d3da8 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,45 @@ +# References: +# - https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-java-packages-with-maven + +name: "Publish to Maven Central" + +on: + push: + tags: + - "*" + +jobs: + publish-to-maven-central: + runs-on: ubuntu-latest + name: Publish to Maven Central + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions/setup-java@v4 + with: + distribution: adopt + java-version: 21 + server-id: central + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + + - id: install-secret-key + name: Install gpg secret key + run: | + # Install gpg secret key + cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import + # Verify gpg secret key + gpg --list-secret-keys --keyid-format LONG + - id: publish-to-central + name: Publish to Central Repository + env: + MAVEN_USERNAME: ${{ vars.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + run: | + mvn \ + --no-transfer-progress \ + --batch-mode \ + -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \ + clean deploy -P release diff --git a/pom.xml b/pom.xml index 3c2a68c..b84316e 100644 --- a/pom.xml +++ b/pom.xml @@ -181,6 +181,16 @@ flagsmith-java-client-${project.version} + + org.sonatype.central + central-publishing-maven-plugin + 0.6.0 + true + + central + true + + org.apache.maven.plugins maven-compiler-plugin From 2ea39c1ffecaed95f9403609486048090965ee8c Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 9 Dec 2024 16:50:26 +0000 Subject: [PATCH 6/6] Bump version 7.4.3 (#170) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b84316e..2f43f53 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.flagsmith flagsmith-java-client - 7.4.2 + 7.4.3 jar Flagsmith Java Client