-
Notifications
You must be signed in to change notification settings - Fork 40
62 lines (56 loc) · 2.11 KB
/
release.yml
File metadata and controls
62 lines (56 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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
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 to the Maven Central Repository
run: |
# Deploy main artifacts (uber JAR, sources, javadoc)
mvn -Prelease --batch-mode deploy -Dnvd.api.key=${{ secrets.NVD_API_KEY }}
- name: Publish Thin JAR as Separate Artifact
run: |
# Sign and deploy thin JAR with full dependency metadata
# Uses GPG signing to ensure artifact integrity
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 \
-DgroupId=com.databricks \
-DartifactId=databricks-jdbc-thin \
-Dversion="${VERSION}" \
-Dpackaging=jar \
-DgeneratePom=false \
-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