Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skip ci] maven central publishing fixes #2759

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions .github/workflows/ossrh-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ on:

env:
GOLANG_VERSION: 1.22
NODEJS_VERSION: 18
JAVA_VERSION_SERVER_BUILD: 17
JAVA_VERSION_CLIENT_BUILD: 11
JAVA_DISTRO: temurin
JAVA_ARCH: x64

jobs:
server-publish:
client-publish:
runs-on: ubuntu-latest-4-cores
steps:
- name: Checkout repository
Expand All @@ -27,31 +26,26 @@ jobs:
with:
go-version: ${{ env.GOLANG_VERSION }}

- name: Setup Node
id: setup-node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODEJS_VERSION }}

- name: Setup Java
id: setup-java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION_SERVER_BUILD }}
java-version: ${{ env.JAVA_VERSION_CLIENT_BUILD }}
distribution: ${{ env.JAVA_DISTRO }}
architecture: ${{ env.JAVA_ARCH }}

- name: Build and Publish Server Modules
run: actions/scripts/publish.sh server
- name: Build and Publish Client Modules
run: actions/scripts/publish.sh client
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
MAVEN_GPG_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
PUBLISH_SKIP_PACKAGES: ${{ secrets.PUBLISH_SKIP_PACKAGES }}

client-publish:
server-publish:
runs-on: ubuntu-latest-4-cores
needs: client-publish
steps:
- name: Checkout repository
id: checkout
Expand All @@ -67,12 +61,12 @@ jobs:
id: setup-java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION_CLIENT_BUILD }}
java-version: ${{ env.JAVA_VERSION_SERVER_BUILD }}
distribution: ${{ env.JAVA_DISTRO }}
architecture: ${{ env.JAVA_ARCH }}

- name: Build and Publish Client Modules
run: actions/scripts/publish.sh client
- name: Build and Publish Server Modules
run: actions/scripts/publish.sh server
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
Expand Down
20 changes: 11 additions & 9 deletions actions/scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function deployProject ()
then
echo "Package $1 already published. Skipping..."
else
until mvn -B deploy -P ossrh -Dmaven.test.skip=true --projects $1
until mvn -B deploy -P ossrh -Dmaven.test.skip=true --projects $1 --settings actions/settings/settings-publish.xml
do
[[ counter -eq $max_retry ]] && echo "Failed to deploy package $1" && exit 1
counter=$(( $counter + 1 ))
Expand All @@ -41,16 +41,18 @@ then
deployProject "com.yahoo.athenz:athenz-msd-java-client"
deployProject "com.yahoo.athenz:athenz-gcp-zts-creds"
else
mvn -B --projects core/zms -Dmaven.test.skip=true install
mvn -B --projects core/zts -Dmaven.test.skip=true install
mvn -B --projects libs/java/auth_core -Dmaven.test.skip=true install
mvn -B --projects libs/java/client_common -Dmaven.test.skip=true install
mvn -B --projects libs/java/cert_refresher -Dmaven.test.skip=true install
mvn -B --projects clients/java/zms -Dmaven.test.skip=true install
mvn -B --projects clients/java/zts -Dmaven.test.skip=true install
mvn -B install --projects "com.yahoo.athenz:athenz" -Dmaven.test.skip=true
mvn -B install --projects "com.yahoo.athenz:athenz-zms-core" -Dmaven.test.skip=true
mvn -B install --projects "com.yahoo.athenz:athenz-zts-core" -Dmaven.test.skip=true
mvn -B install --projects "com.yahoo.athenz:athenz-msd-core" -Dmaven.test.skip=true
mvn -B install --projects "com.yahoo.athenz:athenz-auth-core" -Dmaven.test.skip=true
mvn -B install --projects "com.yahoo.athenz:athenz-client-common" -Dmaven.test.skip=true
mvn -B install --projects "com.yahoo.athenz:athenz-cert-refresher" -Dmaven.test.skip=true
mvn -B install --projects "com.yahoo.athenz:athenz-zms-java-client" -Dmaven.test.skip=true
mvn -B install --projects "com.yahoo.athenz:athenz-zts-java-client" -Dmaven.test.skip=true
deployProject "com.yahoo.athenz:athenz-dynamodb-client-factory"
deployProject "com.yahoo.athenz:athenz-server-common"
deployProject "com.yahoo.athenz:athenz-server-k8s-common"
deployProject "com.yahoo.athenz:athenz-server-aws-common"
deployProject "com.yahoo.athenz:athenz-instance-provider"
deployProject "com.yahoo.athenz:athenz-syncer-common"
fi
9 changes: 9 additions & 0 deletions actions/settings/settings-publish.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>${env.OSSRH_USERNAME}</username>
<password>${env.OSSRH_TOKEN}</password>
</server>
</servers>
</settings>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<maven-jacoco-plugin.version>0.8.12</maven-jacoco-plugin.version>
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
<maven-javadoc-plugin.version>3.7.0</maven-javadoc-plugin.version>
<maven-nexus-plugin.version>1.7.0</maven-nexus-plugin.version>
<maven-nexus-plugin.version>1.6.14</maven-nexus-plugin.version>
<maven-release-plugin.version>3.1.1</maven-release-plugin.version>
<maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
Expand Down
Loading