Skip to content

Commit a086036

Browse files
committed
test
1 parent d88d6ac commit a086036

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/release-thin.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ jobs:
2525
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
2626
gpg-passphrase: GPG_PASSPHRASE
2727

28+
- name: Set up Maven 3.9.9
29+
uses: stCarolas/setup-maven@v1
30+
with:
31+
maven-version: '3.9.9'
32+
2833
- name: Configure GPG
2934
run: |
3035
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
@@ -43,7 +48,7 @@ jobs:
4348
- name: Publish Thin JAR as Separate Artifact to Maven Central
4449
run: |
4550
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/')
46-
mvn -Prelease org.apache.maven.plugins:maven-gpg-plugin:1.6:sign-and-deploy-file \
51+
mvn -Prelease org.apache.maven.plugins:maven-gpg-plugin:3.2.7:sign-and-deploy-file \
4752
-Dfile="target/databricks-jdbc-${VERSION}-thin.jar" \
4853
-DpomFile="thin_public_pom.xml" \
4954
-Dsources="target/databricks-jdbc-${VERSION}-sources.jar" \
@@ -61,10 +66,18 @@ jobs:
6166
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
6267
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
6368
run: |
69+
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/')
6470
echo "Searching for open repo..."
65-
RESP=$(curl -s -u "$MAVEN_CENTRAL_USERNAME:$MAVEN_CENTRAL_PASSWORD" \
66-
"https://ossrh-staging-api.central.sonatype.com/manual/search/repositories?state=open")
67-
KEY=$(echo "$RESP" | grep -o '"key":"[^"]*"' | head -1 | cut -d':' -f2 | tr -d '"')
71+
# Try to find the specific repo that contains our thin component
72+
COMP=$(curl -s -u "$MAVEN_CENTRAL_USERNAME:$MAVEN_CENTRAL_PASSWORD" \
73+
"https://ossrh-staging-api.central.sonatype.com/manual/search/components?namespace=com.databricks&name=databricks-jdbc-thin&version=${VERSION}")
74+
KEY=$(echo "$COMP" | grep -o '"repository"\s*:\s*"[^"]*"' | head -1 | cut -d':' -f2 | tr -d '" ')
75+
if [ -z "$KEY" ]; then
76+
# Fallback to newest open repository (least reliable)
77+
RESP=$(curl -s -u "$MAVEN_CENTRAL_USERNAME:$MAVEN_CENTRAL_PASSWORD" \
78+
"https://ossrh-staging-api.central.sonatype.com/manual/search/repositories?state=open")
79+
KEY=$(echo "$RESP" | grep -o '"key":"[^"]*"' | tail -1 | cut -d':' -f2 | tr -d '"')
80+
fi
6881
if [ -z "$KEY" ]; then echo "No open repo found"; echo "$RESP"; exit 1; fi
6982
echo "Publishing repo $KEY..."
7083
curl -s -X POST -u "$MAVEN_CENTRAL_USERNAME:$MAVEN_CENTRAL_PASSWORD" \

0 commit comments

Comments
 (0)