Skip to content

Commit 5291d95

Browse files
committed
build: updates to fix maven deploy
remove thing from pom fixups
1 parent 1ea86ea commit 5291d95

File tree

4 files changed

+37
-22
lines changed

4 files changed

+37
-22
lines changed

.github/workflows/release-please.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,39 @@ jobs:
9999
- name: Set up Docker Buildx
100100
uses: docker/setup-buildx-action@v3
101101

102+
- name: Construct Maven settings file
103+
run: |
104+
cat > /tmp/maven_settings.xml <<'EOF'
105+
<?xml version="1.0" encoding="UTF-8"?>
106+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
107+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
108+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
109+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
110+
<servers>
111+
<server>
112+
<id>central</id>
113+
<username>${{ secrets.MAVEN_CENTRAL_USERNAME }}</username>
114+
<password>${{ secrets.MAVEN_CENTRAL_PASSWORD }}</password>
115+
</server>
116+
</servers>
117+
</settings>
118+
EOF
119+
120+
- name: Write GPG key and passphrase to files
121+
run: |
122+
echo "${{ secrets.GPG_PRIVATE_KEY }}" > /tmp/gpg_private_key.asc
123+
echo "${{ secrets.SIGN_KEY_PASS }}" > /tmp/gpg_pass.txt
124+
102125
- name: Publish Java package with Docker
103126
uses: docker/build-push-action@v6
104127
with:
105128
context: .
106129
target: openfeature-provider-java.publish
107130
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/cache:main
108-
secrets: |
109-
"maven_settings=${{ secrets.MAVEN_SETTINGS }}"
110-
gpg_private_key=${{ secrets.GPG_PRIVATE_KEY }}
111-
gpg_pass=${{ secrets.SIGN_KEY_PASS }}
131+
secret-files: |
132+
maven_settings=/tmp/maven_settings.xml
133+
gpg_private_key=/tmp/gpg_private_key.asc
134+
gpg_pass=/tmp/gpg_pass.txt
112135
113136
publish-js-provider-release:
114137
needs: release

Dockerfile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# syntax=docker/dockerfile:1.4
1+
# syntax=docker/dockerfile:1
22

33
# ==============================================================================
44
# Base image with Rust toolchain (Alpine - more reliable than Debian)
@@ -490,14 +490,12 @@ RUN make build
490490
# ==============================================================================
491491
FROM openfeature-provider-java.build AS openfeature-provider-java.publish
492492

493-
# Import GPG private key and deploy to Maven Central
494-
RUN --mount=type=secret,id=maven_settings,target=/root/.m2/settings.xml \
495-
--mount=type=secret,id=gpg_private_key \
496-
--mount=type=secret,id=gpg_pass \
497-
# Import GPG key
498-
cat /run/secrets/gpg_private_key | gpg --batch --import && \
499-
# Deploy to Maven Central
500-
mvn -Dgpg.passphrase="$(cat /run/secrets/gpg_pass)" --batch-mode deploy
493+
RUN --mount=type=secret,id=gpg_private_key \
494+
gpg --batch --import /run/secrets/gpg_private_key
495+
496+
RUN --mount=type=secret,id=maven_settings \
497+
--mount=type=secret,id=gpg_pass,env=MAVEN_GPG_PASSPHRASE \
498+
mvn -q -s /run/secrets/maven_settings --batch-mode deploy
501499

502500
# ==============================================================================
503501
# All - Build and validate everything (default target)

openfeature-provider/java/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $(RESOURCES_WASM): $(LOCAL_WASM)
2424
@cp -p $(LOCAL_WASM) $@
2525

2626
$(BUILD_STAMP): pom.xml $(RESOURCES_WASM) $(SRC)
27-
mvn package -DskipTests
27+
mvn -q package -DskipTests
2828
@touch $@
2929

3030
build: $(BUILD_STAMP)

openfeature-provider/java/pom.xml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,8 @@
356356
<plugin>
357357
<groupId>org.apache.maven.plugins</groupId>
358358
<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>
359+
<version>3.2.8</version>
360+
367361
<executions>
368362
<execution>
369363
<id>sign-artifacts</id>

0 commit comments

Comments
 (0)