File tree 3 files changed +46
-1
lines changed
3 files changed +46
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Publish Snapshots to Maven
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ push :
6
+ branches :
7
+ - ' main'
8
+ jobs :
9
+ build-and-publish-snapshots :
10
+ runs-on : ubuntu-latest
11
+
12
+ permissions :
13
+ id-token : write
14
+ contents : write
15
+
16
+ steps :
17
+ - uses : actions/setup-java@v3
18
+ with :
19
+ distribution : temurin # Temurin is a distribution of adoptium
20
+ java-version : 21
21
+ - uses : actions/checkout@v3
22
+ - uses : aws-actions/configure-aws-credentials@v1
23
+ with :
24
+ role-to-assume : ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
25
+ aws-region : us-east-1
26
+ - name : publish snapshots to maven
27
+ run : |
28
+ export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
29
+ export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
30
+ echo "::add-mask::$SONATYPE_USERNAME"
31
+ echo "::add-mask::$SONATYPE_PASSWORD"
32
+ ./tools/java/package_proto_jar.sh
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
7
7
### Added
8
8
- Add bulk + search protos and bazel to compile ([ #5 ] ( https://github.com/opensearch-project/opensearch-protobufs/pull/5 ) )
9
9
- Add scripts to create java opensearch-protobuf-1.0.0.jar ([ #6 ] ( https://github.com/opensearch-project/opensearch-protobufs/pull/6 ) )
10
+ - Add GHA to build and publish snapshots to maven & add mvn process ([ #11 ] ( https://github.com/opensearch-project/opensearch-protobufs/pull/11 ) )
10
11
11
12
### Removed
12
13
Original file line number Diff line number Diff line change 4
4
# Configuration
5
5
GROUP_ID=" org.opensearch.protobuf"
6
6
ARTIFACT_ID=" opensearch-protobuf"
7
- VERSION=" 1.0.0"
7
+ VERSION=" 1.0.0-SNAPSHOT "
8
8
JAR_NAME=" ${ARTIFACT_ID} -${VERSION} .jar"
9
9
POM_NAME=" ${ARTIFACT_ID} -${VERSION} .pom"
10
10
OUTPUT_DIR=" generated/maven"
@@ -216,3 +216,15 @@ echo ""
216
216
echo " dependencies {"
217
217
echo " implementation '${GROUP_ID} :${ARTIFACT_ID} :${VERSION} '"
218
218
echo " }"
219
+
220
+ mvn deploy:deploy-file \
221
+ -Dfile=${OUTPUT_DIR} /${JAR_NAME} \
222
+ -DpomFile=" ${OUTPUT_DIR} /META-INF/maven/${GROUP_ID} /${ARTIFACT_ID} /pom.xml" \
223
+ -DgroupId=${GROUP_ID} \
224
+ -DartifactId=${ARTIFACT_ID} \
225
+ -Dversion=${VERSION} \
226
+ -Dpackaging=jar \
227
+ -DrepositoryId=Snapshots \
228
+ -Durl=https://aws.oss.sonatype.org/content/repositories/snapshots/ \
229
+ -Dusername=$SONATYPE_USERNAME \
230
+ -Dpassword=$SONATYPE_PASSWORD
You can’t perform that action at this time.
0 commit comments