Skip to content

Commit 87e1383

Browse files
committed
maven central deployment
1 parent 75d5a9b commit 87e1383

File tree

5 files changed

+28
-27
lines changed

5 files changed

+28
-27
lines changed

.github/settings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<id>gpg-signing</id>
1515
<properties>
1616
<gpg.executable>gpg</gpg.executable>
17-
<!-- <gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase> -->
1817
</properties>
1918
</profile>
2019
</profiles>

.github/workflows/createRelease.yml

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ jobs:
2828
distribution: "temurin"
2929
java-version: "21"
3030
cache: "maven"
31-
server-id: github
31+
server-id: central
32+
server-username: ${{ secrets.OSSRH_USERNAME }}
33+
server-password: ${{ secrets.OSSRH_PASSWORD }}
34+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
35+
gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
3236

3337
- name: setup python
3438
uses: actions/setup-python@v5
@@ -57,30 +61,19 @@ jobs:
5761
- name: print-pom-version
5862
run: echo "JAVA_POM_VERSION=${{ steps.pom-version.outputs.JAVA_POM_VERSION }}"
5963

60-
- name: check-package-exist
61-
id: check_package_exist
62-
run: python3 .github/scripts/existsGitHubPackageVersion.py
63-
env:
64-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65-
USERNAME: ${{ github.repository_owner }}
66-
PACKAGE_TYPE: maven
67-
PACKAGE_NAME: com.opentelekomcloud.opentelekomcloud-functiongraph-java
68-
PACKAGE_VERSION_NAME: ${{ steps.pom-version.outputs.JAVA_POM_VERSION }}
69-
OUTPUT_NAME: PACKAGE_EXISTS
70-
71-
- name: echo-if-package-exists
72-
if: "${{ steps.check_package_exist.outputs.PACKAGE_EXISTS == 'true' }}"
73-
run: echo "::notice::Package exsits, skipping upload."
74-
75-
- name: deploy-package-to-github
76-
if: "${{ steps.check_package_exist.outputs.PACKAGE_EXISTS != 'true' }}"
64+
- name: Maven deploy
7765
id: deploy_github
7866
run: |
79-
echo "::notice::Uploading Package ..."
80-
mvn -B deploy --file pom.xml \
81-
-DaltDeploymentRepository="github::https://maven.pkg.github.com/${{ github.repository }}"
67+
mvn deploy \
68+
--batch-mode \
69+
--settings .github/settings.xml \
70+
-DskipTests \
71+
-P gpg-signing,cimodules,dev,release,sonatypeDeploy
72+
8273
env:
83-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
75+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
76+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
8477

8578
- name: Create Release
8679
# https://github.com/ncipollo/release-action/blob/main/.github/workflows/release.yml

.github/workflows/java-verify.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
env:
4343
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
4444
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
45-
# GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
4645
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
4746

4847
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*.iws
1010

1111
# vscode
12-
#.vscode
12+
.vscode
1313

1414
# Mac
1515
.DS_Store

core/src/main/java/com/otc/sdk/service/Request.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,12 @@ public void setAppSecrect(String appSecret) throws EmptyStringException {
141141
}
142142
}
143143

144-
144+
/**
145+
* Sets the app key for the request.
146+
*
147+
* @param appKey The app key to set
148+
* @throws EmptyStringException if the appSecret is empty
149+
*/
145150
public void setKey(String appKey) throws EmptyStringException {
146151
if (null != appKey && !appKey.trim().isEmpty()) {
147152
this.key = appKey;
@@ -183,7 +188,12 @@ public void setMethod(String method) throws EmptyStringException {
183188
}
184189
}
185190

186-
191+
/**
192+
* Gets the URL for the request.
193+
*
194+
* @return The url
195+
* @throws UnsupportedEncodingException if the URL encoding fails
196+
*/
187197
public String getUrl() throws UnsupportedEncodingException {
188198
StringBuilder uri = new StringBuilder();
189199
uri.append(this.url);

0 commit comments

Comments
 (0)