File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish snapshots to maven
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ push :
6
+ branches : [
7
+ main
8
+ 1.*
9
+ 2.*
10
+ ]
11
+
12
+ jobs :
13
+ build-and-publish-snapshots :
14
+ runs-on : ubuntu-latest
15
+
16
+ permissions :
17
+ id-token : write
18
+ contents : write
19
+
20
+ steps :
21
+ - uses : actions/setup-java@v3
22
+ with :
23
+ distribution : temurin # Temurin is a distribution of adoptium
24
+ java-version : 11
25
+ - uses : actions/checkout@v3
26
+ - uses : aws-actions/configure-aws-credentials@v1
27
+ with :
28
+ role-to-assume : ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
29
+ aws-region : us-east-1
30
+ - name : publish snapshots to maven
31
+ run : |
32
+ export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
33
+ export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
34
+ echo "::add-mask::$SONATYPE_USERNAME"
35
+ echo "::add-mask::$SONATYPE_PASSWORD"
36
+ ./gradlew publishPluginZipPublicationToSnapshotsRepository
Original file line number Diff line number Diff line change @@ -96,6 +96,16 @@ publishing {
96
96
}
97
97
}
98
98
}
99
+ repositories {
100
+ maven {
101
+ name = " Snapshots" // optional target repository name
102
+ url = " https://aws.oss.sonatype.org/content/repositories/snapshots"
103
+ credentials {
104
+ username " $System . env . SONATYPE_USERNAME "
105
+ password " $System . env . SONATYPE_PASSWORD "
106
+ }
107
+ }
108
+ }
99
109
}
100
110
101
111
allOpen {
You can’t perform that action at this time.
0 commit comments