Skip to content

Commit 9478533

Browse files
feat: [release-please] Java Provider support (#68)
Co-authored-by: Nicklas Lundin <[email protected]>
1 parent 260f5e3 commit 9478533

File tree

13 files changed

+211
-8
lines changed

13 files changed

+211
-8
lines changed

.github/workflows/release-please.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,31 @@ jobs:
127127
platforms: linux/amd64
128128
tags: ${{ steps.meta.outputs.tags }}
129129
labels: ${{ steps.meta.outputs.labels }}
130+
131+
publish-java-provider-release:
132+
needs: release
133+
runs-on: ubuntu-latest
134+
if: ${{ needs.release.outputs.releases_created == 'true' && contains(needs.release.outputs['openfeature-provider-java--release_created'], 'true') }}
135+
steps:
136+
- name: Checkout release tag
137+
uses: actions/checkout@v4
138+
with:
139+
ref: ${{ needs.release.outputs['openfeature-provider-java--tag_name'] }}
140+
141+
- name: Set up JDK 17
142+
uses: actions/setup-java@v3
143+
with:
144+
distribution: 'zulu'
145+
java-version: 17
146+
server-id: central
147+
server-username: MAVEN_USERNAME
148+
server-password: MAVEN_PASSWORD
149+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
150+
gpg-passphrase: GPG_PASS
151+
152+
- name: Deploy with Maven
153+
run: cd openfeature-provider/java && mvn --batch-mode clean deploy
154+
env:
155+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
156+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
157+
GPG_PASS: ${{ secrets.SIGN_KEY_PASS }}

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"confidence-resolver":"0.5.2","confidence-cloudflare-resolver":"0.2.7","wasm-msg":"0.2.0","wasm/rust-guest":"0.1.8","openfeature-provider-local-java":"0.6.4"}
1+
{"confidence-resolver":"0.5.2","confidence-cloudflare-resolver":"0.2.7","wasm-msg":"0.2.0","wasm/rust-guest":"0.1.8","openfeature-provider-java":"0.6.4"}

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
resolver = "2" # Use the new resolver for edition 2021
33

44
members = [
5+
"wasm-msg",
6+
"wasm/rust-guest",
7+
"confidence-resolver",
8+
"confidence-cloudflare-resolver",
9+
"openfeature-provider/java"
10+
]
11+
12+
# Exclude the Java provider from default workspace builds (cargo build --workspace)
13+
# It's a dummy package for release-please tracking only, not meant to be built
14+
default-members = [
515
"wasm-msg",
616
"wasm/rust-guest",
717
"confidence-resolver",

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ COPY confidence-resolver/Cargo.toml ./confidence-resolver/
4545
COPY confidence-cloudflare-resolver/Cargo.toml ./confidence-cloudflare-resolver/
4646
COPY wasm-msg/Cargo.toml ./wasm-msg/
4747
COPY wasm/rust-guest/Cargo.toml ./wasm/rust-guest/
48+
COPY openfeature-provider/java/Cargo.toml ./openfeature-provider/java/
4849

4950
# Copy proto files (needed by build.rs)
5051
COPY confidence-resolver/protos ./confidence-resolver/protos/
@@ -77,7 +78,7 @@ RUN cargo test -p confidence_resolver --lib --no-run --release
7778
RUN cargo build -p rust-guest --target wasm32-unknown-unknown --profile wasm
7879

7980
# Build confidence-cloudflare-resolver dependencies (this layer will be cached)
80-
RUN RUSTFLAGS='--cfg getrandom_backend="wasm_js"' cargo build --target wasm32-unknown-unknown --release
81+
RUN RUSTFLAGS='--cfg getrandom_backend="wasm_js"' cargo build -p confidence-cloudflare-resolver --target wasm32-unknown-unknown --release
8182

8283
# ==============================================================================
8384
# Test & Lint Base - Copy source for testing/linting (native builds)
@@ -95,6 +96,7 @@ COPY confidence-cloudflare-resolver/ ./confidence-cloudflare-resolver/
9596
COPY wasm-msg/ ./wasm-msg/
9697
COPY wasm/rust-guest/ ./wasm/rust-guest/
9798
COPY wasm/proto/ ./wasm/proto/
99+
COPY openfeature-provider/java/Cargo.toml ./openfeature-provider/java/
98100

99101
# Touch files to ensure rebuild (dependencies are cached)
100102
RUN find . -type f -name "*.rs" -exec touch {} +
@@ -146,6 +148,7 @@ COPY confidence-cloudflare-resolver/ ./confidence-cloudflare-resolver/
146148
COPY wasm-msg/ ./wasm-msg/
147149
COPY wasm/rust-guest/ ./wasm/rust-guest/
148150
COPY wasm/proto/ ./wasm/proto/
151+
COPY openfeature-provider/java/Cargo.toml ./openfeature-provider/java/
149152

150153
# Copy data directory (needed by confidence-cloudflare-resolver include_str! macros)
151154
COPY data/ ./data/

confidence-cloudflare-resolver/deployer/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ WORKDIR /workspace
2121
# source changes, but downstream cook stage will be, based on the recipe only.
2222
COPY . .
2323

24+
# Remove the openfeature-provider directory to avoid cargo-chef parsing the dummy Java package
25+
# Also remove all openfeature-provider references from the workspace members list
26+
RUN rm -rf openfeature-provider && \
27+
sed -i '/openfeature-provider/d' Cargo.toml
28+
2429
RUN if [ -d .git ]; then git describe --tags --exact-match 2>/dev/null > /workspace/.release_tag || true; fi
2530
RUN cargo chef prepare --recipe-path recipe.json
2631

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
src/main/resources/wasm/confidence_resolver.wasm
2+
3+
# Dummy Cargo package artifacts (used only for release-please dependency tracking)
4+
Cargo.lock
5+
src/lib.rs
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## 0.6.4 (2025-10-20)
4+
5+
This release was not made from this repository but is mentioned here for linking sake. The release was made from the deprecated repository previously used to work on this provider ( reference: https://github.com/spotify/confidence-sdk-java/releases/tag/v0.6.4).
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "openfeature-provider-java"
3+
version = "0.6.4"
4+
edition = "2021"
5+
publish = false
6+
7+
# This is a dummy Cargo.toml to enable cargo-workspace plugin tracking
8+
# in release-please. The actual package is built with Maven (pom.xml).
9+
# This package depends on rust-guest's WASM output.
10+
#
11+
# Note: This dummy package is never actually built - it exists solely for
12+
# release-please dependency tracking via the cargo-workspace plugin.
13+
14+
[lib]
15+
# Dummy library with no source - cargo won't try to build it
16+
path = "Cargo.toml"
17+
crate-type = []
18+
19+
[dependencies]
20+
rust-guest = { path = "../../wasm/rust-guest", version = "0.1.8" }
21+

openfeature-provider/java/pom.xml

Lines changed: 119 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,54 @@
44

55
<groupId>com.spotify.confidence</groupId>
66
<artifactId>openfeature-provider-local</artifactId>
7-
<version>0.0.0-SNAPSHOT</version>
7+
<version>0.6.4</version>
88
<name>Confidence local resolve provider</name>
9+
<description>Confidence OpenFeature provider for local flag resolution using WebAssembly</description>
10+
<url>https://github.com/spotify/confidence-resolver-rust</url>
11+
12+
<licenses>
13+
<license>
14+
<name>Apache License 2.0</name>
15+
<url>https://github.com/spotify/confidence-resolver-rust/blob/main/LICENSE</url>
16+
<distribution>repo</distribution>
17+
</license>
18+
</licenses>
19+
20+
<scm>
21+
<url>https://github.com/spotify/confidence-resolver-rust</url>
22+
<connection>scm:git:[email protected]:spotify/confidence-resolver-rust.git</connection>
23+
<developerConnection>scm:git:[email protected]:spotify/confidence-resolver-rust.git</developerConnection>
24+
</scm>
25+
26+
<developers>
27+
<developer>
28+
<id>fdema</id>
29+
<email>[email protected]</email>
30+
<name>Fabrizio Demaria</name>
31+
</developer>
32+
<developer>
33+
<id>nicklasl</id>
34+
<email>[email protected]</email>
35+
<name>Nicklas Lundin</name>
36+
</developer>
37+
<developer>
38+
<id>vahidlazio</id>
39+
<email>[email protected]</email>
40+
<name>Vahid Torkaman</name>
41+
</developer>
42+
<developer>
43+
<id>andreas-karlsson</id>
44+
<email>[email protected]</email>
45+
<name>Andreas Karlsson</name>
46+
</developer>
47+
</developers>
48+
49+
<distributionManagement>
50+
<repository>
51+
<id>central</id>
52+
<url>https://central.sonatype.com/repository/maven-releases/</url>
53+
</repository>
54+
</distributionManagement>
955

1056
<properties>
1157
<!-- Required by maven to compile Java 11 -->
@@ -271,6 +317,77 @@
271317
<useModulePath>false</useModulePath>
272318
</configuration>
273319
</plugin>
320+
321+
<!-- Generate sources JAR -->
322+
<plugin>
323+
<artifactId>maven-source-plugin</artifactId>
324+
<version>3.3.0</version>
325+
<executions>
326+
<execution>
327+
<id>attach-sources</id>
328+
<goals>
329+
<goal>jar-no-fork</goal>
330+
</goals>
331+
</execution>
332+
</executions>
333+
</plugin>
334+
335+
<!-- Generate Javadoc JAR -->
336+
<plugin>
337+
<groupId>org.apache.maven.plugins</groupId>
338+
<artifactId>maven-javadoc-plugin</artifactId>
339+
<version>3.6.0</version>
340+
<executions>
341+
<execution>
342+
<id>attach-javadocs</id>
343+
<goals>
344+
<goal>jar</goal>
345+
</goals>
346+
</execution>
347+
</executions>
348+
<configuration>
349+
<excludePackageNames>
350+
com.spotify.confidence.flags.*
351+
</excludePackageNames>
352+
</configuration>
353+
</plugin>
354+
355+
<!-- GPG Signing -->
356+
<plugin>
357+
<groupId>org.apache.maven.plugins</groupId>
358+
<artifactId>maven-gpg-plugin</artifactId>
359+
<version>3.1.0</version>
360+
<configuration>
361+
<gpgArguments>
362+
<arg>--pinentry-mode</arg>
363+
<arg>loopback</arg>
364+
<arg>--no-tty</arg>
365+
</gpgArguments>
366+
</configuration>
367+
<executions>
368+
<execution>
369+
<id>sign-artifacts</id>
370+
<phase>install</phase>
371+
<goals>
372+
<goal>sign</goal>
373+
</goals>
374+
</execution>
375+
</executions>
376+
</plugin>
377+
378+
<!-- Maven Central Publishing -->
379+
<plugin>
380+
<groupId>org.sonatype.central</groupId>
381+
<artifactId>central-publishing-maven-plugin</artifactId>
382+
<version>0.8.0</version>
383+
<extensions>true</extensions>
384+
<configuration>
385+
<publishingServerId>central</publishingServerId>
386+
<deploymentName>Confidence OpenFeature Local Provider</deploymentName>
387+
<autoPublish>true</autoPublish>
388+
<waitUntil>published</waitUntil>
389+
</configuration>
390+
</plugin>
274391
</plugins>
275392

276393
<resources>
@@ -291,4 +408,4 @@
291408
</resources>
292409
</build>
293410

294-
</project>
411+
</project>

0 commit comments

Comments
 (0)