Skip to content

Commit 35aa7f4

Browse files
Revert "Unified release workflow for shaded and thin JARs (#1073)" (#1081)
## Description <!-- Provide a brief summary of the changes made and the issue they aim to address.--> This reverts commit 9a5e7c9. NO_CHANGELOG=true ## Testing <!-- Describe how the changes have been tested--> ## Additional Notes to the Reviewer <!-- Share any additional context or insights that may help the reviewer understand the changes better. This could include challenges faced, limitations, or compromises made during the development process. Also, mention any areas of the code that you would like the reviewer to focus on specifically. -->
1 parent 5057a1a commit 35aa7f4

3 files changed

Lines changed: 69 additions & 51 deletions

File tree

.github/workflows/release-thin.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Release Thin JAR
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish-thin:
10+
runs-on:
11+
group: databricks-protected-runner-group
12+
labels: linux-ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Java for publishing to Maven Central Repository
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: 11
21+
distribution: "adopt"
22+
server-id: central
23+
server-username: MAVEN_CENTRAL_USERNAME
24+
server-password: MAVEN_CENTRAL_PASSWORD
25+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
26+
gpg-passphrase: GPG_PASSPHRASE
27+
28+
- name: Configure GPG
29+
run: |
30+
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
31+
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
32+
gpg-connect-agent reloadagent /bye
33+
34+
- name: Build thin JAR
35+
run: |
36+
mvn -B -DskipTests package
37+
38+
- name: Verify thin jar exists
39+
run: |
40+
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/')
41+
test -f "target/databricks-jdbc-${VERSION}-oss-thin.jar"
42+
43+
- name: Publish Thin JAR as Separate Artifact to Maven Central
44+
run: |
45+
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/')
46+
mvn -Prelease gpg:sign-and-deploy-file \
47+
-Dfile="target/databricks-jdbc-${VERSION}-oss-thin.jar" \
48+
-DrepositoryId=central \
49+
-Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ \
50+
-DgroupId=com.databricks \
51+
-DartifactId=databricks-jdbc-thin \
52+
-Dversion="${VERSION}" \
53+
-Dpackaging=jar \
54+
-DgeneratePom=true \
55+
-Dgpg.passphrase="${GPG_PASSPHRASE}"
56+
env:
57+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
58+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
59+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
60+
61+
- name: Upload Thin JAR to GitHub Release
62+
uses: softprops/action-gh-release@v1
63+
with:
64+
files: |
65+
target/*-oss-thin.jar
66+

.github/workflows/release.yml

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,9 @@ jobs:
2727
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
2828
gpg-passphrase: GPG_PASSPHRASE
2929

30-
- name: Configure GPG
30+
- name: Publish to the Maven Central Repository
3131
run: |
32-
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
33-
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
34-
gpg-connect-agent reloadagent /bye
35-
36-
- name: Publish shaded JAR to Maven Central
37-
run: |
38-
# Deploy main artifacts (shaded uber JAR, sources, javadoc)
32+
# Deploy main artifacts (uber JAR, sources, javadoc)
3933
mvn -Prelease --batch-mode deploy \
4034
-Dnvd.api.key=${{ secrets.NVD_API_KEY }} \
4135
-Dossindex.username=${{ secrets.OSSINDEX_USERNAME }} \
@@ -45,26 +39,8 @@ jobs:
4539
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
4640
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
4741

48-
- name: Publish thin JAR as separate artifact to Maven Central
49-
run: |
50-
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/')
51-
mvn -Prelease gpg:sign-and-deploy-file \
52-
-Dfile="target/databricks-jdbc-${VERSION}-thin.jar" \
53-
-DpomFile=thin_public_pom.xml \
54-
-DrepositoryId=central \
55-
-Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ \
56-
-DgroupId=com.databricks \
57-
-DartifactId=databricks-jdbc-thin \
58-
-Dversion="${VERSION}" \
59-
-Dpackaging=jar \
60-
-Dgpg.passphrase="${GPG_PASSPHRASE}"
61-
env:
62-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
63-
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
64-
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
65-
6642
- name: Create GitHub release
6743
uses: softprops/action-gh-release@v1
6844
with:
6945
files: |
70-
target/*.jar
46+
files: target/*.jar

pom.xml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -474,30 +474,6 @@
474474
</excludes>
475475
</configuration>
476476
</plugin>
477-
<!-- Attach unshaded JAR before shade plugin runs -->
478-
<plugin>
479-
<groupId>org.codehaus.mojo</groupId>
480-
<artifactId>build-helper-maven-plugin</artifactId>
481-
<version>3.6.1</version>
482-
<executions>
483-
<execution>
484-
<id>attach-thin-jar</id>
485-
<phase>package</phase>
486-
<goals>
487-
<goal>attach-artifact</goal>
488-
</goals>
489-
<configuration>
490-
<artifacts>
491-
<artifact>
492-
<file>${project.build.directory}/${project.build.finalName}.jar</file>
493-
<type>jar</type>
494-
<classifier>thin</classifier>
495-
</artifact>
496-
</artifacts>
497-
</configuration>
498-
</execution>
499-
</executions>
500-
</plugin>
501477
<plugin>
502478
<groupId>org.apache.maven.plugins</groupId>
503479
<artifactId>maven-shade-plugin</artifactId>

0 commit comments

Comments
 (0)