Skip to content

Commit b85b949

Browse files
ps48derek-ho
andauthored
adding maven-publish file (#670) #665
Signed-off-by: Shenoy Pratik <[email protected]> Co-authored-by: Derek Ho <[email protected]>
1 parent cf3550d commit b85b949

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/maven-publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish snapshots to maven
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- '1.3'
9+
- 2.x
10+
11+
jobs:
12+
build-and-publish-snapshots:
13+
runs-on: ubuntu-latest
14+
15+
permissions:
16+
id-token: write
17+
contents: write
18+
19+
steps:
20+
- uses: actions/setup-java@v3
21+
with:
22+
distribution: temurin # Temurin is a distribution of adoptium
23+
java-version: 11
24+
- uses: actions/checkout@v3
25+
- uses: aws-actions/configure-aws-credentials@v1
26+
with:
27+
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
28+
aws-region: us-east-1
29+
- name: publish snapshots to maven
30+
run: |
31+
export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
32+
export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
33+
echo "::add-mask::$SONATYPE_USERNAME"
34+
echo "::add-mask::$SONATYPE_PASSWORD"
35+
./gradlew publishPluginZipPublicationToSnapshotsRepository

0 commit comments

Comments
 (0)