Release v3.0.5 (#1095) #21
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Thin JAR | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| publish-thin: | |
| runs-on: | |
| group: databricks-protected-runner-group | |
| labels: linux-ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Java for publishing to Maven Central Repository | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 11 | |
| distribution: "adopt" | |
| server-id: central | |
| server-username: MAVEN_CENTRAL_USERNAME | |
| server-password: MAVEN_CENTRAL_PASSWORD | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| gpg-passphrase: GPG_PASSPHRASE | |
| - name: Configure GPG | |
| run: | | |
| echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf | |
| echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf | |
| gpg-connect-agent reloadagent /bye | |
| - name: Build thin JAR with sources and javadocs | |
| run: | | |
| # Build main artifacts including sources and javadocs | |
| mvn -B -DskipTests package source:jar javadoc:jar | |
| - name: Sign all thin JAR artifacts | |
| run: | | |
| VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/') | |
| # Sign thin JAR | |
| echo "$GPG_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 --pinentry-mode loopback \ | |
| --armor --detach-sign "target/databricks-jdbc-${VERSION}-thin.jar" | |
| # Sign sources JAR | |
| echo "$GPG_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 --pinentry-mode loopback \ | |
| --armor --detach-sign "target/databricks-jdbc-${VERSION}-sources.jar" | |
| # Sign javadoc JAR | |
| echo "$GPG_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 --pinentry-mode loopback \ | |
| --armor --detach-sign "target/databricks-jdbc-${VERSION}-javadoc.jar" | |
| env: | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Verify all required artifacts exist | |
| run: | | |
| VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/') | |
| test -f "target/databricks-jdbc-${VERSION}-thin.jar" | |
| test -f "target/databricks-jdbc-${VERSION}-thin.jar.asc" | |
| test -f "target/databricks-jdbc-${VERSION}-sources.jar" | |
| test -f "target/databricks-jdbc-${VERSION}-sources.jar.asc" | |
| test -f "target/databricks-jdbc-${VERSION}-javadoc.jar" | |
| test -f "target/databricks-jdbc-${VERSION}-javadoc.jar.asc" | |
| - name: Publish Thin JAR as Separate Artifact to Maven Central | |
| run: | | |
| VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/') | |
| echo "Creating deployment bundle for thin JAR..." | |
| # Create staging directory | |
| mkdir -p target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION} | |
| # Copy thin JAR and its signature | |
| cp "target/databricks-jdbc-${VERSION}-thin.jar" \ | |
| target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}.jar | |
| cp "target/databricks-jdbc-${VERSION}-thin.jar.asc" \ | |
| target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}.jar.asc | |
| # Copy sources JAR and its signature | |
| cp "target/databricks-jdbc-${VERSION}-sources.jar" \ | |
| target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}-sources.jar | |
| cp "target/databricks-jdbc-${VERSION}-sources.jar.asc" \ | |
| target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}-sources.jar.asc | |
| # Copy javadoc JAR and its signature | |
| cp "target/databricks-jdbc-${VERSION}-javadoc.jar" \ | |
| target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}-javadoc.jar | |
| cp "target/databricks-jdbc-${VERSION}-javadoc.jar.asc" \ | |
| target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}-javadoc.jar.asc | |
| # Copy POM and sign it | |
| cp thin_public_pom.xml target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}.pom | |
| echo "$GPG_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 --pinentry-mode loopback \ | |
| --armor --detach-sign \ | |
| target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}.pom | |
| # Generate checksums for all files | |
| cd target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION} | |
| for file in databricks-jdbc-thin-*; do | |
| md5sum "$file" | awk '{print $1}' > "${file}.md5" | |
| sha1sum "$file" | awk '{print $1}' > "${file}.sha1" | |
| done | |
| cd $GITHUB_WORKSPACE | |
| # Create bundle ZIP | |
| cd target/thin-staging | |
| zip -r ../central-thin-bundle.zip com/ | |
| cd $GITHUB_WORKSPACE | |
| echo "Uploading bundle to Maven Central Portal..." | |
| # Upload to new Maven Central Portal | |
| curl -X POST \ | |
| -u "$MAVEN_CENTRAL_USERNAME:$MAVEN_CENTRAL_PASSWORD" \ | |
| -F "bundle=@target/central-thin-bundle.zip" \ | |
| -F "publishingType=AUTOMATIC" \ | |
| -w "\nHTTP_STATUS:%{http_code}\n" \ | |
| https://central.sonatype.com/api/v1/publisher/upload | |
| echo "Thin JAR published successfully!" | |
| env: | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| - name: Upload Thin JAR to GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| target/*-thin.jar | |