-
Notifications
You must be signed in to change notification settings - Fork 126
187 lines (168 loc) · 6.95 KB
/
Copy pathmobile-sdk-docs.yml
File metadata and controls
187 lines (168 loc) · 6.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: Mobile SDK API docs
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, labeled, unlabeled]
push:
branches: [main]
workflow_call:
inputs:
deploy:
description: "Package the generated HTML into the sdk-docs image and publish it (release only)"
required: false
type: boolean
default: false
version:
description: "Release version used to tag the sdk-docs image"
required: false
type: string
default: ""
tags:
description: 'JSON array of extra tags for the sdk-docs image, e.g. ["stable"]'
required: false
type: string
default: '[]'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
pull-requests: read
jobs:
macos-eligibility:
uses: ./.github/workflows/macos-eligibility.yml
with:
event-name: ${{ github.event_name }}
ref: ${{ github.ref }}
pr-number: ${{ github.event.pull_request.number || '' }}
pr-head-repo: ${{ github.event.pull_request.head.repo.full_name || '' }}
pr-labels: ${{ toJson(github.event.pull_request.labels.*.name) }}
pr-draft: ${{ github.event.pull_request.draft || false }}
mobile-sdk-docs:
needs: macos-eligibility
if: ${{ needs.macos-eligibility.outputs.should-run == 'true' }}
runs-on: macos-26
env:
XCODE_DEVELOPER_DIR: /Applications/Xcode_26.6.app/Contents/Developer
steps:
- name: Checkout all repos with ref fallback
uses: walt-id/waltid-identity/.github/actions/checkout-repos@4296a7f80cacf7e60cb1a20321956768892eb7e3
with:
token: ${{ secrets.GH_ACCESS_TOKEN || github.token }}
ref: ${{ github.head_ref || github.ref_name }}
- name: Configure gradle
uses: walt-id/waltid-identity/.github/actions/gradle-setup-action@864f84343fdeea17f6f63434bc8036c39f178dc7
- name: Check mobile SDK API contract
timeout-minutes: 20
working-directory: waltid-identity
env:
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN || github.token }}
run: |
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
git fetch --prune --unshallow origin
fi
git fetch --prune origin main
./gradlew \
:waltid-libraries:protocols:waltid-openid4vc-wallet-mobile:checkKotlinAbi \
:waltid-libraries:protocols:waltid-openid4vc-wallet-persistence-mobile:checkKotlinAbi \
-PenableAndroidBuild=true \
-PenableIosBuild=true \
--no-daemon \
--console=plain
scripts/check-mobile-swift-parity-decision.sh
- name: Generate mobile SDK API docs
timeout-minutes: 45
uses: walt-id/waltid-identity/.github/actions/gradle-mobile-sdk-docs@88ae3106d2882f728b7c79f16295dcf665506af3
with:
waltid-directory: 'waltid-identity'
xcode-developer-dir: ${{ env.XCODE_DEVELOPER_DIR }}
- name: Collect generated HTML
if: ${{ inputs.deploy }}
shell: bash
run: |
base="waltid-identity/waltid-libraries/protocols"
out="$RUNNER_TEMP/sdk-docs-html"
rm -rf "$out"
mkdir -p "$out/wallet-mobile" "$out/wallet-persistence-mobile"
cp -R "$base/waltid-openid4vc-wallet-mobile/build/dokka/html/." "$out/wallet-mobile/"
cp -R "$base/waltid-openid4vc-wallet-persistence-mobile/build/dokka/html/." "$out/wallet-persistence-mobile/"
# Landing page linking the two module docs.
cat > "$out/index.html" <<'HTML'
<!doctype html>
<html lang="en">
<head><meta charset="utf-8"><title>walt.id Mobile SDK API docs</title></head>
<body>
<h1>walt.id Mobile SDK API documentation</h1>
<ul>
<li><a href="wallet-mobile/index.html">OpenID4VC Wallet (mobile)</a></li>
<li><a href="wallet-persistence-mobile/index.html">OpenID4VC Wallet persistence (mobile)</a></li>
</ul>
</body>
</html>
HTML
- name: Upload SDK docs HTML artifact
if: ${{ inputs.deploy }}
uses: actions/upload-artifact@v7
with:
name: sdk-docs-html
path: ${{ runner.temp }}/sdk-docs-html
retention-days: 1
- name: Package Swift WalletSDK DocC archive
working-directory: waltid-identity
run: |
tar -czf \
waltid-libraries/protocols/waltid-wallet-sdk-ios/build/docc/WalletSDK.doccarchive.tar.gz \
-C waltid-libraries/protocols/waltid-wallet-sdk-ios/build/docc \
WalletSDK.doccarchive
- name: Upload Swift WalletSDK DocC archive
uses: actions/upload-artifact@v4
with:
name: walletsdk-doccarchive
path: waltid-identity/waltid-libraries/protocols/waltid-wallet-sdk-ios/build/docc/WalletSDK.doccarchive.tar.gz
if-no-files-found: error
publish:
needs: mobile-sdk-docs
runs-on: ubuntu-latest
steps:
- name: Skip publishing outside deploy mode
if: ${{ inputs.deploy != true }}
run: echo "SDK docs image publishing is disabled for this run."
- name: Checkout all repos with ref fallback
if: ${{ inputs.deploy == true }}
uses: walt-id/waltid-identity/.github/actions/checkout-repos@4296a7f80cacf7e60cb1a20321956768892eb7e3
with:
token: ${{ secrets.GH_ACCESS_TOKEN || github.token }}
ref: ${{ github.head_ref || github.ref_name }}
- name: Download SDK docs HTML artifact
if: ${{ inputs.deploy == true }}
uses: actions/download-artifact@v5
with:
name: sdk-docs-html
path: waltid-identity/docs/mobile-sdk-api/html
- name: Login to Docker Hub
if: ${{ inputs.deploy == true }}
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
if: ${{ inputs.deploy == true }}
uses: docker/setup-buildx-action@v4
- name: Generate Docker tags
if: ${{ inputs.deploy == true }}
id: tags
run: |
TAGS="waltid/waltid-sdk-docs:${{ inputs.version }}, waltid/waltid-sdk-docs:latest"
for tag in $(echo '${{ inputs.tags }}' | jq -r '.[]'); do
TAGS="$TAGS, waltid/waltid-sdk-docs:$tag"
done
echo "tags=$TAGS" >> $GITHUB_OUTPUT
- name: Build and push sdk-docs image
if: ${{ inputs.deploy == true }}
uses: docker/build-push-action@v7
with:
platforms: linux/amd64,linux/arm64
push: true
file: waltid-identity/docs/mobile-sdk-api/Dockerfile
context: waltid-identity/docs/mobile-sdk-api
tags: ${{ steps.tags.outputs.tags }}