Release v3.0.4 (#1078) #62
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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| 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 | |
| env: | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| with: | |
| java-version: 11 | |
| server-id: central | |
| distribution: "adopt" | |
| 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: Publish shaded JAR to Maven Central | |
| run: | | |
| # Deploy main artifacts (shaded uber JAR, sources, javadoc) | |
| mvn -Prelease --batch-mode deploy \ | |
| -Dnvd.api.key=${{ secrets.NVD_API_KEY }} \ | |
| -Dossindex.username=${{ secrets.OSSINDEX_USERNAME }} \ | |
| -Dossindex.password=${{ secrets.OSSINDEX_PASSWORD }} | |
| env: | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| - name: Publish thin JAR as separate artifact to Maven Central | |
| run: | | |
| VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/') | |
| mvn -Prelease gpg:sign-and-deploy-file \ | |
| -Dfile="target/databricks-jdbc-${VERSION}-thin.jar" \ | |
| -DpomFile=thin_public_pom.xml \ | |
| -DrepositoryId=central \ | |
| -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ \ | |
| -DgroupId=com.databricks \ | |
| -DartifactId=databricks-jdbc-thin \ | |
| -Dversion="${VERSION}" \ | |
| -Dpackaging=jar \ | |
| -Dgpg.passphrase="${GPG_PASSPHRASE}" | |
| env: | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| target/*.jar |