11# This workflow will build the project with Gradle, run integration tests, and release.
2- # Because secrets are not available on external forks, this job is expected to fail
3- # on external pull requests.
2+ # Secret-backed jobs fetch credentials from AWS Secrets Manager using GitHub OIDC.
43
54name : Build, Check, Publish
65
@@ -14,19 +13,19 @@ jobs:
1413 build :
1514 runs-on : ubuntu-latest
1615 steps :
17- - uses : actions/checkout@v4
16+ - uses : actions/checkout@v7
1817
1918 - name : Gradle Wrapper Validation
20- uses : gradle/actions/wrapper-validation@v4
19+ uses : gradle/actions/wrapper-validation@v6
2120
2221 - name : Set up JDK 21
23- uses : actions/setup-java@v4
22+ uses : actions/setup-java@v5
2423 with :
2524 java-version : ' 21'
2625 distribution : ' zulu'
2726
2827 - name : Set up Python
29- uses : actions/setup-python@v3
28+ uses : actions/setup-python@v6
3029 with :
3130 python-version : ' 3.9.14'
3231 - run : python -m pip install ply six packaging
4645 - name : Ensure no changes in Generated Code
4746 run : ./scripts/check-clean-git-status
4847
49- - name : Obtain oauth access token for integration tests
50- env :
51- APP_KEY : ${{ secrets.APP_KEY }}
52- APP_SECRET : ${{ secrets.APP_SECRET }}
53- REFRESH_TOKEN : ${{ secrets.REFRESH_TOKEN }}
54- run : ./generate-ci-auth-file
55-
5648 - name : Ensure Binary Compatibility
5749 run : ./gradlew :core:apiCheck :android:apiCheck
5850
6254 - name : Check
6355 run : ./gradlew check
6456
57+ integration :
58+ runs-on : ubuntu-latest
59+ if : github.repository == 'dropbox/dropbox-sdk-java' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
60+ needs : [build]
61+ permissions :
62+ id-token : write
63+ contents : read
64+ steps :
65+ - uses : actions/checkout@v7
66+
67+ - name : Gradle Wrapper Validation
68+ uses : gradle/actions/wrapper-validation@v6
69+
70+ - name : Set up JDK 21
71+ uses : actions/setup-java@v5
72+ with :
73+ java-version : ' 21'
74+ distribution : ' zulu'
75+
76+ - name : Set up Python
77+ uses : actions/setup-python@v6
78+ with :
79+ python-version : ' 3.9.14'
80+ - run : python -m pip install ply six packaging
81+
82+ - name : Grant execute permissions
83+ run : chmod +x gradlew
84+ && chmod +x update-submodules
85+ && chmod +x generate-ci-auth-file
86+
87+ - name : Set up submodules
88+ run : ./update-submodules
89+
90+ - name : Generate Stone
91+ run : ./gradlew :core:generateStone
92+
93+ - name : Configure AWS credentials (OIDC)
94+ uses : aws-actions/configure-aws-credentials@v6
95+ with :
96+ role-to-assume : arn:aws:iam::521590706193:role/oidc-github-dropbox-dropbox-sdk-java-branch-main
97+ aws-region : us-west-2
98+
99+ - name : Get integration test secrets from AWS Secrets Manager
100+ uses : aws-actions/aws-secretsmanager-get-secrets@v3
101+ with :
102+ secret-ids : |
103+ APP_KEY,dropbox-sdk-java-app-key
104+ APP_SECRET,dropbox-sdk-java-app-secret
105+ REFRESH_TOKEN,dropbox-sdk-java-refresh-token
106+ parse-json-secrets : false
107+
108+ - name : Obtain oauth access token for integration tests
109+ run : ./generate-ci-auth-file
110+
65111 - name : Run Integration Tests for Examples
66112 run : ./gradlew :examples:examples:test :examples:java:test -Pci=true --info
67113
@@ -80,22 +126,25 @@ jobs:
80126 publish :
81127 runs-on : ubuntu-latest
82128 if : github.repository == 'dropbox/dropbox-sdk-java' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
83- needs : [build]
129+ needs : [build, integration]
130+ permissions :
131+ id-token : write
132+ contents : read
84133 steps :
85134 - name : Checkout
86- uses : actions/checkout@v4
135+ uses : actions/checkout@v7
87136
88137 - name : Gradle Wrapper Validation
89- uses : gradle/actions/wrapper-validation@v4
138+ uses : gradle/actions/wrapper-validation@v6
90139
91140 - name : Install JDK 21
92- uses : actions/setup-java@v4
141+ uses : actions/setup-java@v5
93142 with :
94143 distribution : ' zulu'
95144 java-version : 21
96145
97146 - name : Set up Python
98- uses : actions/setup-python@v3
147+ uses : actions/setup-python@v6
99148 with :
100149 python-version : ' 3.9.14'
101150 - run : python -m pip install ply && pip install six
@@ -106,13 +155,29 @@ jobs:
106155 - name : Update submodules
107156 run : ./update-submodules
108157
158+ - name : Configure AWS credentials (OIDC)
159+ uses : aws-actions/configure-aws-credentials@v6
160+ with :
161+ role-to-assume : arn:aws:iam::521590706193:role/oidc-github-dropbox-dropbox-sdk-java-branch-main
162+ aws-region : us-west-2
163+
164+ - name : Get Maven Central secrets from AWS Secrets Manager
165+ uses : aws-actions/aws-secretsmanager-get-secrets@v3
166+ with :
167+ secret-ids : |
168+ OSSRH_USERNAME,sdk-release-maven-central-token-username
169+ OSSRH_PASSWORD,sdk-release-maven-central-token-password
170+ SIGNING_KEY,sdk-release-signing-key
171+ SIGNING_PASSWORD,sdk-release-signing-password
172+ parse-json-secrets : false
173+
109174 - name : Upload Artifacts
110175 run : ./gradlew publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
111176 env :
112- ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets .OSSRH_USERNAME }}
113- ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets .OSSRH_PASSWORD }}
114- ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ secrets .SIGNING_KEY }}
115- ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ${{ secrets .SIGNING_PASSWORD }}
177+ ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ env .OSSRH_USERNAME }}
178+ ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ env .OSSRH_PASSWORD }}
179+ ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ env .SIGNING_KEY }}
180+ ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ${{ env .SIGNING_PASSWORD }}
116181
117182 - name : Retrieve version
118183 run : |
@@ -122,27 +187,27 @@ jobs:
122187 run : ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel
123188 if : " !endsWith(env.VERSION_NAME, '-SNAPSHOT')"
124189 env :
125- ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets .OSSRH_USERNAME }}
126- ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets .OSSRH_PASSWORD }}
190+ ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ env .OSSRH_USERNAME }}
191+ ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ env .OSSRH_PASSWORD }}
127192
128193 - name : Upload Test Reports
129- uses : actions/upload-artifact@v3
194+ uses : actions/upload-artifact@v4
130195 with :
131196 name : TestReports
132197 path : |
133198 core/build/reports/
134199 android/build/reports/
135200
136201 - name : Upload JavaDocs
137- uses : actions/upload-artifact@v3
202+ uses : actions/upload-artifact@v4
138203 with :
139204 name : JavaDocs
140205 path : |
141206 core/build/docs/javadoc/
142207 android/build/docs/javadoc/
143208
144209 - name : Upload Build Artifacts
145- uses : actions/upload-artifact@v3
210+ uses : actions/upload-artifact@v4
146211 with :
147212 name : BuildArtifacts
148213 path : |
0 commit comments