Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
./decrypt_secret.sh
./tools/decrypt_secret.sh
- name: Deploy
env:
OKTA_DUMMY_CI_PW: ${{ secrets.OKTA_DUMMY_CI_PW }}
Expand All @@ -25,8 +25,12 @@ jobs:
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
run: |
export GPG_TTY=$(tty)
source ./passphrase.env # load $MAVEN_GPG_PASSHRASE for maven-gpg-plugin
mvn -DskipTests clean package
mvn -s settings.xml deploy
mvn -s settings.xml \
-Dcentral-publishing.autoPublish=true \
-Dcentral-publishing.waitUntil=published \
deploy
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
57 changes: 23 additions & 34 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<packaging>jar</packaging>
<version>6.0.0-SNAPSHOT</version>

<name>Weaviate Java Client</name>
<description>A Java client for Weaviate Vector Search Engine</description>
<name>${project.groupId}:${project.artifactId}</name>
<description>Official Java client for Weaviate Vector Search Engine</description>
<url>https://github.com/weaviate/java-client</url>

<organization>
Expand Down Expand Up @@ -45,17 +45,6 @@
<tag>6.0.0-beta2</tag>
</scm>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.sourceEncoding>UTF-8</project.reporting.sourceEncoding>
Expand Down Expand Up @@ -343,7 +332,7 @@
</execution>
<execution>
<id>add-test-source</id>
<phase>process-resources</phase>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
Expand Down Expand Up @@ -392,7 +381,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -401,9 +390,9 @@
<goal>sign</goal>
</goals>
<configuration>
<!-- ${gpg.keyname} is set in settings.xml from settings.tar.gpg archive -->
<useAgent>true</useAgent>
<keyname>${gpg.keyname}</keyname>
<passphraseServerId>${gpg.keyname}</passphraseServerId>
<bestPractices>true</bestPractices>
<gpgArguments>
<arg>--batch</arg>
<arg>--pinentry-mode</arg>
Expand All @@ -421,33 +410,33 @@
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>

<!-- Maven includes maven-deploy-plugin by default, but we want to delegate -->
<!-- deployement to a third-party plugin. We add this entry to override <skip> -->
<!-- and ensure we dont' accidentaily publish twice. -->
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<!-- Auto-publishing is disabled by default to prevent accidental deployments. -->
<!-- When testing, it is therefore safe to run `mvn deploy` from your local machine, -->
<!-- as publishing will require manual action. -->
<!-- In CI we override this option to true and waitUtil=published. -->
<autoPublish>${central-publishing.autoPublish}</autoPublish>
<waitUntil>${central-publishing.waitUntil}</waitUntil>
</configuration>
</plugin>

<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.9.1</version>
Expand Down Expand Up @@ -484,8 +473,8 @@
<artifactId>maven-gpg-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
Binary file modified secrets.tar.gpg
Binary file not shown.
6 changes: 4 additions & 2 deletions src/it/java/io/weaviate/containers/Container.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.testcontainers.lifecycle.Startable;

import io.weaviate.client6.v1.api.WeaviateClient;
import lombok.RequiredArgsConstructor;

public class Container {
public static final Weaviate WEAVIATE = Weaviate.createDefault();
Expand Down Expand Up @@ -85,10 +84,13 @@ public TestRule asTestRule() {
};
}

@RequiredArgsConstructor
public static class PerTestSuite implements TestRule {
private final Startable container;

public PerTestSuite(Startable container) {
this.container = container;
}

@Override
public Statement apply(Statement base, Description description) {
return new Statement() {
Expand Down
1 change: 1 addition & 0 deletions decrypt_secret.sh → tools/decrypt_secret.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

# Options:
# --batch to prevent interactive command
# --yes to assume "yes" for questions
gpg --quiet --batch --yes --decrypt --passphrase="$GPG_PASSPHRASE" --output secrets.tar secrets.tar.gpg
Expand Down
27 changes: 27 additions & 0 deletions tools/encrypt_secret.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -euo pipefail

# This script generates a GPG-ecrypted tarball with our signing GPG key
# and Maven Central Repository credentials.
#
# Make sure that key.gpg, settings.xml, and passphrase.env exist in the current directory.
# Delete these files after the script has run. Only commit secrets.tar.gpg!

rm -f secrets.tar &&
tar --no-xattrs -czf secrets.tar key.gpg settings.xml passphrase.env

rm -f secrets.tar.gpg &&
gpg --batch --symmetric \
--passphrase "$GPG_PASSPHRASE" \
--output secrets.tar.gpg \
secrets.tar

rm -f secrets.tar

echo "Tarball secrets.tar.gpg generated successfully."
echo "Remember to delete the plaintext files. Only commit secrets.tar.gpg to source control!"
echo
echo " \$ git add secrets.tar.gpg && git commit -m 'ci: update secrets.tar.gpg'"
echo " \$ rm key.gpg settings.xml passphrase.env"
echo