|
1 | | -# Template: SDK Release Documentation Notification |
| 1 | +# SDK Release Documentation Pipeline |
2 | 2 | # |
3 | | -# Copy this workflow to your SDK repository and configure the SDK_TYPE variable. |
4 | | -# When a release is published, it will notify the sendbird-docs repository to |
5 | | -# generate documentation updates based on the release notes. |
| 3 | +# When a release is published, this workflow: |
| 4 | +# 1. Triggers docs validation (claude-docs-validation) on client-workflows |
| 5 | +# 2. Notifies sendbird-docs to generate documentation update PRs |
6 | 6 | # |
7 | | -# Required setup: |
8 | | -# 1. Copy this file to your SDK repo: .github/workflows/notify-docs-update.yml |
9 | | -# 2. Update the SDK_TYPE environment variable to match your SDK |
10 | | -# 3. Create a GitHub Personal Access Token with 'repo' scope |
11 | | -# 4. Add the token as a secret named DOCS_REPO_TOKEN in your SDK repo |
| 7 | +# Can also be triggered manually via workflow_dispatch for re-runs. |
12 | 8 | # |
13 | | -# SDK_TYPE options: |
14 | | -# - chat-sdk-javascript |
15 | | -# - chat-sdk-ios |
16 | | -# - chat-sdk-android |
17 | | -# - chat-sdk-flutter |
18 | | -# - chat-sdk-unity |
19 | | -# - uikit-react |
20 | | -# - uikit-react-native |
21 | | -# - uikit-ios |
22 | | -# - uikit-android |
23 | | -# - uikit-swiftui |
| 9 | +# Required secrets: |
| 10 | +# DOCS_REPO_TOKEN - GitHub token with repo access to sendbird-docs |
| 11 | +# SDK_REPO_TOKEN - GitHub token with repo access to client-workflows |
24 | 12 |
|
25 | | -name: Notify Docs Repository on Release |
| 13 | +name: Release Docs Pipeline |
26 | 14 |
|
27 | 15 | on: |
28 | 16 | release: |
29 | 17 | types: [published] |
| 18 | + workflow_dispatch: |
| 19 | + inputs: |
| 20 | + release_tag: |
| 21 | + description: 'Release tag (e.g., v3.17.0)' |
| 22 | + required: true |
| 23 | + type: string |
30 | 24 |
|
31 | 25 | env: |
32 | | - # UPDATE THIS: Set to your SDK type (see options above) |
33 | 26 | SDK_TYPE: uikit-react |
| 27 | + PLATFORM: react |
34 | 28 | DOCS_REPO: sendbird/sendbird-docs |
35 | 29 |
|
36 | 30 | jobs: |
| 31 | + docs-validation: |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + - name: Trigger docs validation |
| 35 | + uses: actions/github-script@v7 |
| 36 | + with: |
| 37 | + github-token: ${{ secrets.SDK_REPO_TOKEN }} |
| 38 | + script: | |
| 39 | + await github.rest.actions.createWorkflowDispatch({ |
| 40 | + owner: 'sendbird', |
| 41 | + repo: 'client-workflows', |
| 42 | + workflow_id: 'claude-docs-validation.yml', |
| 43 | + ref: 'main', |
| 44 | + inputs: { |
| 45 | + sdk_type: '${{ env.SDK_TYPE }}', |
| 46 | + platform: '${{ env.PLATFORM }}', |
| 47 | + release_tag: '${{ github.event.release.tag_name || inputs.release_tag }}', |
| 48 | + source_repo: '${{ github.repository }}' |
| 49 | + } |
| 50 | + }); |
| 51 | + - name: Summary |
| 52 | + run: | |
| 53 | + echo "## Docs Validation Triggered" >> $GITHUB_STEP_SUMMARY |
| 54 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 55 | + echo "- **SDK:** ${{ env.SDK_TYPE }}" >> $GITHUB_STEP_SUMMARY |
| 56 | + echo "- **Release:** ${{ github.event.release.tag_name || inputs.release_tag }}" >> $GITHUB_STEP_SUMMARY |
| 57 | +
|
37 | 58 | notify-docs: |
38 | 59 | runs-on: ubuntu-latest |
39 | 60 | steps: |
40 | 61 | - name: Trigger documentation update |
41 | 62 | env: |
42 | 63 | GH_TOKEN: ${{ secrets.DOCS_REPO_TOKEN }} |
43 | 64 | run: | |
44 | | - # Extract repository info |
45 | 65 | SDK_REPO="${{ github.repository }}" |
46 | | - RELEASE_TAG="${{ github.event.release.tag_name }}" |
| 66 | + RELEASE_TAG="${{ github.event.release.tag_name || inputs.release_tag }}" |
47 | 67 | RELEASE_URL="${{ github.event.release.html_url }}" |
48 | 68 |
|
49 | 69 | echo "Triggering docs update for:" |
50 | 70 | echo " SDK Repo: $SDK_REPO" |
51 | 71 | echo " Release Tag: $RELEASE_TAG" |
52 | 72 | echo " SDK Type: $SDK_TYPE" |
53 | 73 |
|
54 | | - # Trigger repository_dispatch event on docs repo |
55 | 74 | curl -X POST \ |
56 | 75 | -H "Accept: application/vnd.github+json" \ |
57 | 76 | -H "Authorization: Bearer $GH_TOKEN" \ |
|
73 | 92 | run: | |
74 | 93 | echo "## Documentation Update Triggered" >> $GITHUB_STEP_SUMMARY |
75 | 94 | echo "" >> $GITHUB_STEP_SUMMARY |
76 | | - echo "A documentation update request has been sent to the docs repository." >> $GITHUB_STEP_SUMMARY |
77 | | - echo "" >> $GITHUB_STEP_SUMMARY |
78 | 95 | echo "- **SDK:** ${{ env.SDK_TYPE }}" >> $GITHUB_STEP_SUMMARY |
79 | | - echo "- **Release:** ${{ github.event.release.tag_name }}" >> $GITHUB_STEP_SUMMARY |
| 96 | + echo "- **Release:** ${{ github.event.release.tag_name || inputs.release_tag }}" >> $GITHUB_STEP_SUMMARY |
80 | 97 | echo "- **Docs Repo:** ${{ env.DOCS_REPO }}" >> $GITHUB_STEP_SUMMARY |
0 commit comments