-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update publish steps for maven central (#2755)
* update publish steps for maven central * remove screwdriver references --------- Signed-off-by: Henry Avetisyan <[email protected]>
- Loading branch information
1 parent
af0fce7
commit 82862be
Showing
31 changed files
with
168 additions
and
231 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Publish Athenz packages to Maven Central | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v1.12.*' | ||
|
||
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: | ||
runs-on: ubuntu-latest-4-cores | ||
steps: | ||
- name: Checkout repository | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Golang | ||
id: setup-go | ||
uses: actions/setup-go@v4 | ||
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 }} | ||
distribution: ${{ env.JAVA_DISTRO }} | ||
architecture: ${{ env.JAVA_ARCH }} | ||
server-id: ossrh | ||
server-username: OSSRH_USERNAME | ||
server-password: OSSRH_TOKEN | ||
gpg-private-key: ${{ secrets.MAVEN_GPG_SIGNING_KEY }} | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
|
||
- name: Build and Publish Server Modules | ||
run: actions/scripts/publish.sh server | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }} | ||
|
||
client-publish: | ||
runs-on: ubuntu-latest-4-cores | ||
steps: | ||
- name: Checkout repository | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Golang | ||
id: setup-go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GOLANG_VERSION }} | ||
|
||
- name: Setup Java | ||
id: setup-java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ env.JAVA_VERSION_CLIENT_BUILD }} | ||
distribution: ${{ env.JAVA_DISTRO }} | ||
architecture: ${{ env.JAVA_ARCH }} | ||
server-id: ossrh | ||
server-username: OSSRH_USERNAME | ||
server-password: OSSRH_TOKEN | ||
gpg-private-key: ${{ secrets.MAVEN_GPG_SIGNING_KEY }} | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
|
||
- name: Build and Publish Client Modules | ||
run: actions/scripts/publish.sh client | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env bash | ||
|
||
MODULE_TYPE=$1 | ||
|
||
function deployProject () | ||
{ | ||
max_retry=3 | ||
counter=0 | ||
echo "Publishing package $1..." | ||
|
||
# before publishing we need to make sure that the package | ||
# is not being asked to be skipped since it was already | ||
# published in a previous build | ||
|
||
if [[ $PUBLISH_SKIP_PACKAGES == *"$1"* ]] | ||
then | ||
echo "Package $1 already published. Skipping..." | ||
else | ||
until mvn -B deploy -P ossrh -Dmaven.test.skip=true --projects $1 | ||
do | ||
[[ counter -eq $max_retry ]] && echo "Failed to deploy package $1" && exit 1 | ||
counter=$(( $counter + 1 )) | ||
sleep 30 | ||
echo "Re-trying to publish package (attempt #$counter)" | ||
done | ||
fi | ||
} | ||
|
||
if [[ "$MODULE_TYPE" = "client" ]]; | ||
then | ||
deployProject "com.yahoo.athenz:athenz" | ||
deployProject "com.yahoo.athenz:athenz-zms-core" | ||
deployProject "com.yahoo.athenz:athenz-zts-core" | ||
deployProject "com.yahoo.athenz:athenz-msd-core" | ||
deployProject "com.yahoo.athenz:athenz-auth-core" | ||
deployProject "com.yahoo.athenz:athenz-client-common" | ||
deployProject "com.yahoo.athenz:athenz-cert-refresher" | ||
deployProject "com.yahoo.athenz:athenz-zms-java-client" | ||
deployProject "com.yahoo.athenz:athenz-zts-java-client" | ||
deployProject "com.yahoo.athenz:athenz-zpe-java-client" | ||
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 | ||
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 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.