Skip to content

Commit 13f4bd2

Browse files
authored
Enhance CI workflow for Maven build and deployment
Updated the CI workflow to include steps for verifying Maven configuration and deploying to Sonatype with correct profiles.
1 parent fe881ae commit 13f4bd2

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
Skip to content
2-
HuaweiCloudDeveloper
3-
gaussdb-flink-connector-jdbc
4-
Repository navigation
5-
Code
6-
Issues
7-
Pull requests
8-
Actions
9-
Projects
10-
Wiki
11-
Security
12-
3
13-
(3)
14-
Insights
15-
Settings
16-
Java CI with Maven
17-
modified #13
18-
All jobs
19-
Run details
20-
Workflow file for this run
21-
.github/workflows/ci.yml at 3e231e6
221
# This workflow will build a Java project with Maven
232
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
243

@@ -33,28 +12,49 @@ jobs:
3312
if: github.repository == 'HuaweiCloudDeveloper/gaussdb-flink-connector-jdbc'
3413
runs-on: ubuntu-latest
3514
environment: gaussdb-flink-connector-jdbc-build
15+
3616
steps:
37-
- uses: actions/checkout@v4
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
3820
- name: Set up JDK 17
3921
uses: actions/setup-java@v4
4022
with:
4123
java-version: 17
4224
distribution: adopt
4325
cache: maven
26+
# Sonatype 认证配置
27+
server-id: sonatype
28+
server-username: SONATYPE_USER
29+
server-password: SONATYPE_PASSWORD
30+
# GPG 配置(用于签名)
31+
gpg-private-key: ${{ secrets.GPG_KEY_BASE64 }}
32+
gpg-passphrase: GPG_PASSPHRASE
33+
4434
- name: Set up Maven
4535
uses: stCarolas/setup-maven@v5
4636
with:
4737
maven-version: 3.9.9
48-
- uses: actions/cache@v4
38+
39+
- name: Cache Maven dependencies
40+
uses: actions/cache@v4
4941
with:
5042
path: ~/.m2/repository
5143
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
5244
restore-keys: |
5345
${{ runner.os }}-maven-
54-
- name: Build with Maven
46+
47+
- name: Verify Maven configuration
48+
run: |
49+
echo "Maven version:"
50+
mvn --version
51+
echo "Checking Maven settings:"
52+
ls -la ~/.m2/ || echo "~/.m2/ directory not found"
53+
54+
- name: Deploy to Sonatype
5555
env:
5656
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
5757
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
58-
GPG_KEY_BASE64: ${{ secrets.GPG_KEY_BASE64 }}
5958
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
60-
run: mvn -B deploy -P snapshot -s settings.xml
59+
# 使用正确的 profile,移除自定义 settings.xml
60+
run: mvn -B clean deploy -P central

0 commit comments

Comments
 (0)