Skip to content

Commit 82862be

Browse files
authored
update publish steps for maven central (#2755)
* update publish steps for maven central * remove screwdriver references --------- Signed-off-by: Henry Avetisyan <[email protected]>
1 parent af0fce7 commit 82862be

File tree

31 files changed

+168
-231
lines changed

31 files changed

+168
-231
lines changed

.github/workflows/ossrh-publish.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Publish Athenz packages to Maven Central
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v1.12.*'
7+
8+
env:
9+
GOLANG_VERSION: 1.22
10+
NODEJS_VERSION: 18
11+
JAVA_VERSION_SERVER_BUILD: 17
12+
JAVA_VERSION_CLIENT_BUILD: 11
13+
JAVA_DISTRO: temurin
14+
JAVA_ARCH: x64
15+
16+
jobs:
17+
server-publish:
18+
runs-on: ubuntu-latest-4-cores
19+
steps:
20+
- name: Checkout repository
21+
id: checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Golang
25+
id: setup-go
26+
uses: actions/setup-go@v4
27+
with:
28+
go-version: ${{ env.GOLANG_VERSION }}
29+
30+
- name: Setup Node
31+
id: setup-node
32+
uses: actions/setup-node@v3
33+
with:
34+
node-version: ${{ env.NODEJS_VERSION }}
35+
36+
- name: Setup Java
37+
id: setup-java
38+
uses: actions/setup-java@v4
39+
with:
40+
java-version: ${{ env.JAVA_VERSION_SERVER_BUILD }}
41+
distribution: ${{ env.JAVA_DISTRO }}
42+
architecture: ${{ env.JAVA_ARCH }}
43+
server-id: ossrh
44+
server-username: OSSRH_USERNAME
45+
server-password: OSSRH_TOKEN
46+
gpg-private-key: ${{ secrets.MAVEN_GPG_SIGNING_KEY }}
47+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
48+
49+
- name: Build and Publish Server Modules
50+
run: actions/scripts/publish.sh server
51+
env:
52+
MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
53+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
54+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
55+
56+
client-publish:
57+
runs-on: ubuntu-latest-4-cores
58+
steps:
59+
- name: Checkout repository
60+
id: checkout
61+
uses: actions/checkout@v4
62+
63+
- name: Setup Golang
64+
id: setup-go
65+
uses: actions/setup-go@v4
66+
with:
67+
go-version: ${{ env.GOLANG_VERSION }}
68+
69+
- name: Setup Java
70+
id: setup-java
71+
uses: actions/setup-java@v4
72+
with:
73+
java-version: ${{ env.JAVA_VERSION_CLIENT_BUILD }}
74+
distribution: ${{ env.JAVA_DISTRO }}
75+
architecture: ${{ env.JAVA_ARCH }}
76+
server-id: ossrh
77+
server-username: OSSRH_USERNAME
78+
server-password: OSSRH_TOKEN
79+
gpg-private-key: ${{ secrets.MAVEN_GPG_SIGNING_KEY }}
80+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
81+
82+
- name: Build and Publish Client Modules
83+
run: actions/scripts/publish.sh client
84+
env:
85+
MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
86+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
87+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}

.github/workflows/pull-request.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Pull Requests
33
on:
44
pull_request:
55
branches:
6-
- '1.12.x-jetty12'
6+
- 'master'
77

88
env:
99
GOLANG_VERSION: 1.22
@@ -69,4 +69,4 @@ jobs:
6969
architecture: ${{ env.JAVA_ARCH }}
7070

7171
- name: Build Athenz Clients
72-
run: mvn -B -pl rdl/rdl-gen-athenz-java-model,rdl/rdl-gen-athenz-java-client,core/zms,core/zts,core/msd,libs/java/auth_core,libs/java/client_common,libs/java/cert_refresher,clients/java/zms,clients/java/zts,clients/java/zpe,clients/java/msd,libs/java/gcp_zts_creds install
72+
run: mvn -B -pl core/zms,core/zts,core/msd,libs/java/auth_core,libs/java/client_common,libs/java/cert_refresher,clients/java/zms,clients/java/zts,clients/java/zpe,clients/java/msd,libs/java/gcp_zts_creds install

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,10 @@
22

33
# Athenz
44

5-
[![Pipeline Status][status-image]][status-url]
6-
[![Publish Status][publish-status-image]][status-url]
75
[![SourceSpy Dashboard](https://sourcespy.com/shield.svg)](https://sourcespy.com/github/athenzathenz/)
86
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4681/badge)](https://bestpractices.coreinfrastructure.org/projects/4681)
97
[![Licenses](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FAthenZ%2Fathenz.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FAthenZ%2Fathenz?ref=badge_shield)
108

11-
[status-image]: https://cd.screwdriver.cd/pipelines/6606/badge
12-
[publish-status-image]: https://cd.screwdriver.cd/pipelines/6606/publish/badge
13-
[status-url]: https://cd.screwdriver.cd/pipelines/6606
14-
15-
169
> Athenz is an open source platform for X.509 certificate based service authentication and fine-grained
1710
> access control in dynamic infrastructures. It supports provisioning and configuration (centralized
1811
> authorization) use cases as well as serving/runtime (decentralized authorization) use cases. Athenz
@@ -35,7 +28,7 @@ support for the following three major functional areas.
3528

3629
### Service Authentication
3730

38-
Athenz provides secure identity in the form of short lived X.509 certificate
31+
Athenz provides secure identity in the form of short-lived X.509 certificate
3932
for every workload or service deployed in private (e.g. Openstack, K8S, Screwdriver)
4033
or public cloud (e.g. AWS EC2, ECS, Fargate, Lambda). Using these X.509 certificates
4134
clients and services establish secure connections and through mutual TLS authentication verify

actions/scripts/publish.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env bash
2+
3+
MODULE_TYPE=$1
4+
5+
function deployProject ()
6+
{
7+
max_retry=3
8+
counter=0
9+
echo "Publishing package $1..."
10+
11+
# before publishing we need to make sure that the package
12+
# is not being asked to be skipped since it was already
13+
# published in a previous build
14+
15+
if [[ $PUBLISH_SKIP_PACKAGES == *"$1"* ]]
16+
then
17+
echo "Package $1 already published. Skipping..."
18+
else
19+
until mvn -B deploy -P ossrh -Dmaven.test.skip=true --projects $1
20+
do
21+
[[ counter -eq $max_retry ]] && echo "Failed to deploy package $1" && exit 1
22+
counter=$(( $counter + 1 ))
23+
sleep 30
24+
echo "Re-trying to publish package (attempt #$counter)"
25+
done
26+
fi
27+
}
28+
29+
if [[ "$MODULE_TYPE" = "client" ]];
30+
then
31+
deployProject "com.yahoo.athenz:athenz"
32+
deployProject "com.yahoo.athenz:athenz-zms-core"
33+
deployProject "com.yahoo.athenz:athenz-zts-core"
34+
deployProject "com.yahoo.athenz:athenz-msd-core"
35+
deployProject "com.yahoo.athenz:athenz-auth-core"
36+
deployProject "com.yahoo.athenz:athenz-client-common"
37+
deployProject "com.yahoo.athenz:athenz-cert-refresher"
38+
deployProject "com.yahoo.athenz:athenz-zms-java-client"
39+
deployProject "com.yahoo.athenz:athenz-zts-java-client"
40+
deployProject "com.yahoo.athenz:athenz-zpe-java-client"
41+
deployProject "com.yahoo.athenz:athenz-msd-java-client"
42+
deployProject "com.yahoo.athenz:athenz-gcp-zts-creds"
43+
else
44+
mvn -B --projects core/zms -Dmaven.test.skip=true install
45+
mvn -B --projects core/zts -Dmaven.test.skip=true install
46+
mvn -B --projects libs/java/auth_core -Dmaven.test.skip=true install
47+
mvn -B --projects libs/java/client_common -Dmaven.test.skip=true install
48+
mvn -B --projects libs/java/cert_refresher -Dmaven.test.skip=true install
49+
mvn -B --projects clients/java/zms -Dmaven.test.skip=true install
50+
mvn -B --projects clients/java/zts -Dmaven.test.skip=true install
51+
deployProject "com.yahoo.athenz:athenz-server-common"
52+
deployProject "com.yahoo.athenz:athenz-server-k8s-common"
53+
deployProject "com.yahoo.athenz:athenz-server-aws-common"
54+
deployProject "com.yahoo.athenz:athenz-instance-provider"
55+
deployProject "com.yahoo.athenz:athenz-syncer-common"
56+
fi

clients/go/msd/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export GOPATH ?= /tmp/go
1616
# we're not going to generate our code during our automated builds since
1717
# builds must be done based on files already checked-in into git
1818

19-
CICD := $(or ${SCREWDRIVER},${TRAVIS_PULL_REQUEST},${TRAVIS_TAG})
19+
CICD := $(or ${GITHUB_ACTIONS},${SCREWDRIVER},${TRAVIS_PULL_REQUEST},${TRAVIS_TAG})
2020

2121
ifdef CICD
2222

clients/go/zms/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export GOPATH ?= /tmp/go
1616
# we're not going to generate our code during our automated builds since
1717
# builds must be done based on files already checked-in into git
1818

19-
CICD := $(or ${SCREWDRIVER},${TRAVIS_PULL_REQUEST},${TRAVIS_TAG})
19+
CICD := $(or ${GITHUB_ACTIONS},${SCREWDRIVER},${TRAVIS_PULL_REQUEST},${TRAVIS_TAG})
2020

2121
ifdef CICD
2222

clients/go/zts/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export GOPATH ?= /tmp/go
1616
# we're not going to generate our code during our automated builds since
1717
# builds must be done based on files already checked-in into git
1818

19-
CICD := $(or ${SCREWDRIVER},${TRAVIS_PULL_REQUEST},${TRAVIS_TAG})
19+
CICD := $(or ${GITHUB_ACTIONS},${SCREWDRIVER},${TRAVIS_PULL_REQUEST},${TRAVIS_TAG})
2020

2121
ifdef CICD
2222

clients/java/msd/scripts/make_stubs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# however, we're not going to run this utility during our automated builds since
99
# builds must be done based on files already checked-in into git
1010

11-
if [ ! -z "${SCREWDRIVER}" ]; then
11+
if [ ! -z "${GITHUB_ACTIONS}" ]; then
1212
echo >&2 "------------------------------------------------------------------------";
1313
echo >&2 "SOURCE NOTICE";
1414
echo >&2 "------------------------------------------------------------------------";

clients/java/zms/scripts/make_stubs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# however, we're not going to run this utility during our automated builds since
66
# builds must be done based on files already checked-in into git
77

8-
if [ ! -z "${SCREWDRIVER}" ] || [ ! -z "${TRAVIS_PULL_REQUEST}" ] || [ ! -z "${TRAVIS_TAG}" ]; then
8+
if [ ! -z "${GITHUB_ACTIONS}" ]; then
99
echo >&2 "------------------------------------------------------------------------";
1010
echo >&2 "SOURCE NOTICE";
1111
echo >&2 "------------------------------------------------------------------------";

clients/java/zts/scripts/make_stubs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# however, we're not going to run this utility during our automated builds since
66
# builds must be done based on files already checked-in into git
77

8-
if [ ! -z "${SCREWDRIVER}" ] || [ ! -z "${TRAVIS_PULL_REQUEST}" ] || [ ! -z "${TRAVIS_TAG}" ]; then
8+
if [ ! -z "${GITHUB_ACTIONS}" ]; then
99
echo >&2 "------------------------------------------------------------------------";
1010
echo >&2 "SOURCE NOTICE";
1111
echo >&2 "------------------------------------------------------------------------";

core/msd/scripts/make_stubs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# however, we're not going to run this utility during our automated builds since
88
# builds must be done based on files already checked-in into git
99

10-
if [ ! -z "${SCREWDRIVER}" ]; then
10+
if [ ! -z "${GITHUB_ACTIONS}" ]; then
1111
echo >&2 "------------------------------------------------------------------------";
1212
echo >&2 "SOURCE NOTICE";
1313
echo >&2 "------------------------------------------------------------------------";

core/zms/scripts/make_stubs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# however, we're not going to run this utility during our automated builds since
66
# builds must be done based on files already checked-in into git
77

8-
if [ ! -z "${SCREWDRIVER}" ] || [ ! -z "${TRAVIS_PULL_REQUEST}" ] || [ ! -z "${TRAVIS_TAG}" ]; then
8+
if [ ! -z "${GITHUB_ACTIONS}" ]; then
99
echo >&2 "------------------------------------------------------------------------";
1010
echo >&2 "SOURCE NOTICE";
1111
echo >&2 "------------------------------------------------------------------------";

core/zts/scripts/make_stubs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# however, we're not going to run this utility during our automated builds since
66
# builds must be done based on files already checked-in into git
77

8-
if [ ! -z "${SCREWDRIVER}" ] || [ ! -z "${TRAVIS_PULL_REQUEST}" ] || [ ! -z "${TRAVIS_TAG}" ]; then
8+
if [ ! -z "${GITHUB_ACTIONS}" ]; then
99
echo >&2 "------------------------------------------------------------------------";
1010
echo >&2 "SOURCE NOTICE";
1111
echo >&2 "------------------------------------------------------------------------";

docker/util/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ARG BUILD_DATE
55
ARG VCS_REF
66

77
ENV SCREWDRIVER true
8+
ENV GITHUB_ACTIONS true
89

910
LABEL org.label-schema.schema-version="1.0"
1011
LABEL org.label-schema.build-date=$BUILD_DATE

docker/util/athenz-builder/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ARG BUILD_DATE
55
ARG VCS_REF
66

77
ENV SCREWDRIVER true
8+
ENV GITHUB_ACTIONS true
89

910
LABEL org.label-schema.schema-version="1.0"
1011
LABEL org.label-schema.build-date=$BUILD_DATE

pom.xml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@
115115
<maven-checkstyle-plugin.version>3.4.0</maven-checkstyle-plugin.version>
116116
<maven-dependency-plugin.version>3.7.1</maven-dependency-plugin.version>
117117
<maven-exec-plugin.version>3.3.0</maven-exec-plugin.version>
118-
<maven-gpg-plugin.version>3.2.4</maven-gpg-plugin.version>
118+
<maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
119119
<maven-install-plugin.version>3.1.2</maven-install-plugin.version>
120120
<maven-jacoco-plugin.version>0.8.12</maven-jacoco-plugin.version>
121121
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
122122
<maven-javadoc-plugin.version>3.7.0</maven-javadoc-plugin.version>
123+
<maven-nexus-plugin.version>1.7.0</maven-nexus-plugin.version>
123124
<maven-release-plugin.version>3.1.1</maven-release-plugin.version>
124125
<maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
125126
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
@@ -437,18 +438,6 @@
437438
<profiles>
438439
<profile>
439440
<id>ossrh</id>
440-
<properties>
441-
<gpg.executable>gpg</gpg.executable>
442-
<!--suppress UnresolvedMavenProperty -->
443-
<gpg.keyname>${env.GPG_KEYNAME}</gpg.keyname>
444-
<!--suppress UnresolvedMavenProperty -->
445-
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
446-
<gpg.defaultKeyring>false</gpg.defaultKeyring>
447-
<!--suppress UnresolvedMavenProperty -->
448-
<gpg.homedir>${env.SD_SOURCE_DIR}/screwdriver/deploy</gpg.homedir>
449-
<gpg.publickeyring>pubring.gpg</gpg.publickeyring>
450-
<gpg.secretkeyring>secring.gpg</gpg.secretkeyring>
451-
</properties>
452441
<activation>
453442
<property>
454443
<name>performRelease</name>
@@ -458,7 +447,6 @@
458447
<build>
459448
<plugins>
460449
<plugin>
461-
<groupId>org.apache.maven.plugins</groupId>
462450
<artifactId>maven-gpg-plugin</artifactId>
463451
<version>${maven-gpg-plugin.version}</version>
464452
<executions>
@@ -469,18 +457,15 @@
469457
<goal>sign</goal>
470458
</goals>
471459
<configuration>
472-
<gpgArguments>
473-
<arg>--pinentry-mode</arg>
474-
<arg>loopback</arg>
475-
</gpgArguments>
460+
<signer>bc</signer>
476461
</configuration>
477462
</execution>
478463
</executions>
479464
</plugin>
480465
<plugin>
481466
<groupId>org.sonatype.plugins</groupId>
482467
<artifactId>nexus-staging-maven-plugin</artifactId>
483-
<version>1.6.8</version>
468+
<version>${maven-nexus-plugin.version}</version>
484469
<extensions>true</extensions>
485470
<configuration>
486471
<stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>

rdl/rdl-gen-athenz-go-client/make_generator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# generated. Otherwise, the client has all the auto-generated code already
77
# checked-in into git.
88

9-
if [ ! -z "${SCREWDRIVER}" ] || [ ! -z "${TRAVIS_PULL_REQUEST}" ] || [ ! -z "${TRAVIS_TAG}" ]; then
9+
if [ ! -z "${GITHUB_ACTIONS}" ]; then
1010
echo >&2 "------------------------------------------------------------------------";
1111
echo >&2 "SOURCE NOTICE";
1212
echo >&2 "------------------------------------------------------------------------";

rdl/rdl-gen-athenz-go-model/make_generator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# generated. Otherwise, the client has all the auto-generated code already
77
# checked-in into git.
88

9-
if [ ! -z "${SCREWDRIVER}" ] || [ ! -z "${TRAVIS_PULL_REQUEST}" ] || [ ! -z "${TRAVIS_TAG}" ]; then
9+
if [ ! -z "${GITHUB_ACTIONS}" ]; then
1010
echo >&2 "------------------------------------------------------------------------";
1111
echo >&2 "SOURCE NOTICE";
1212
echo >&2 "------------------------------------------------------------------------";

rdl/rdl-gen-athenz-java-client/make_generator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# generated. Otherwise, the client has all the auto-generated code already
77
# checked-in into git.
88

9-
if [ ! -z "${SCREWDRIVER}" ] || [ ! -z "${TRAVIS_PULL_REQUEST}" ] || [ ! -z "${TRAVIS_TAG}" ]; then
9+
if [ ! -z "${GITHUB_ACTIONS}" ]; then
1010
echo >&2 "------------------------------------------------------------------------";
1111
echo >&2 "SOURCE NOTICE";
1212
echo >&2 "------------------------------------------------------------------------";

rdl/rdl-gen-athenz-java-model/make_generator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# generated. Otherwise, the client has all the auto-generated code already
77
# checked-in into git.
88

9-
if [ ! -z "${SCREWDRIVER}" ] || [ ! -z "${TRAVIS_PULL_REQUEST}" ] || [ ! -z "${TRAVIS_TAG}" ]; then
9+
if [ ! -z "${GITHUB_ACTIONS}" ]; then
1010
echo >&2 "------------------------------------------------------------------------";
1111
echo >&2 "SOURCE NOTICE";
1212
echo >&2 "------------------------------------------------------------------------";

rdl/rdl-gen-athenz-server/make_generator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# generated. Otherwise, the server has all the auto-generated code already
77
# checked-in into git.
88

9-
if [ ! -z "${SCREWDRIVER}" ] || [ ! -z "${TRAVIS_PULL_REQUEST}" ] || [ ! -z "${TRAVIS_TAG}" ]; then
9+
if [ ! -z "${GITHUB_ACTIONS}" ]; then
1010
echo >&2 "------------------------------------------------------------------------";
1111
echo >&2 "SOURCE NOTICE";
1212
echo >&2 "------------------------------------------------------------------------";

0 commit comments

Comments
 (0)