Skip to content

Commit d512d22

Browse files
Generate Kotlin docs (#7265)
1 parent 27fa3d9 commit d512d22

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

.github/workflows/artifacts-build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,55 @@ jobs:
265265
echo "📖 Dart docs"
266266
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.sha }}/dartdoc/index.html"
267267
268+
kotlin-docs:
269+
name: "Kotlin docs"
270+
needs: credentials
271+
runs-on: "ubuntu-latest"
272+
steps:
273+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
274+
275+
# GCP Boilerplate for jobs in main or forked repository (needs credentials)
276+
- id: gcp-auth
277+
if: github.ref != 'refs/heads/main' || github.repository != 'unicode-org/icu4x'
278+
name: "Authenticate to Google Cloud with JSON Credentials"
279+
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
280+
with:
281+
credentials_json: '${{ secrets.ICU4X_GCP_SA_KEY }}'
282+
- id: gcp-auth-main
283+
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
284+
name: "Authenticate to Google Cloud with Workload Identity Provider"
285+
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
286+
with:
287+
workload_identity_provider: "projects/66042061814/locations/global/workloadIdentityPools/icu4x-gha-pool1/providers/icu4x-gha-provider1"
288+
service_account: "[email protected]"
289+
- name: "Set up Google Cloud SDK"
290+
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
291+
292+
- name: Build docs
293+
run: |
294+
cd ffi/mvn
295+
mvn dokka:dokka
296+
cd ../..
297+
298+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
299+
with:
300+
name: kdoc
301+
path: ffi/mvn/target/dokka
302+
303+
- name: Upload docs to Google Cloud Storage (non-main)
304+
run: |
305+
gsutil -m cp -r ffi/mvn/target/dokka gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/kdoc
306+
307+
- name: Upload docs to Google Cloud Storage (main)
308+
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
309+
run: |
310+
gsutil -m cp -r ffi/mvn/target/dokka/* gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/kdoc
311+
312+
- name: "⭐⭐⭐ Links to Uploaded Artifacts ⭐⭐⭐"
313+
run: |
314+
echo "📖 Kotlin docs"
315+
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.sha }}/kdoc/index.html"
316+
268317
wasm-demo:
269318
# This is too expensive to run on every push, so only run it on main.
270319
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'

.github/workflows/artifacts-info.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,8 @@ jobs:
4040
echo "📖 Dart docs"
4141
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.event.pull_request.head.sha }}/dartdoc/index.html"
4242
echo
43+
echo "📖 Kotlin docs"
44+
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.event.pull_request.head.sha }}/kdoc/icu4x/org.unicode.icu4x/index.html"
45+
echo
4346
echo "The links will be available after the following job completes:"
4447
echo "${{ github.event.pull_request.head.repo.html_url }}/actions/workflows/artifacts-build.yml"

ffi/mvn/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,19 @@
154154
</dependency>
155155
</dependencies>
156156
</plugin>
157+
<plugin>
158+
<groupId>org.jetbrains.dokka</groupId>
159+
<artifactId>dokka-maven-plugin</artifactId>
160+
<version>${kotlin.version}</version>
161+
<executions>
162+
<execution>
163+
<phase>pre-site</phase>
164+
<goals>
165+
<goal>dokka</goal>
166+
</goals>
167+
</execution>
168+
</executions>
169+
</plugin>
157170
</plugins>
158171
</build>
159172
</project>

0 commit comments

Comments
 (0)