Prerelease #57
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ============================================================================= | |
| # publish-api-docs.yml — agentcore-cli | |
| # ============================================================================= | |
| # Auto-generates the CLI command reference as AsciiDoc (.adoc) on every release | |
| # by scraping `agentcore <cmd> --help` for all commands (grouped by category), | |
| # and uploads it as a build artifact for the docs team to publish. | |
| # | |
| # Pipeline: install released CLI -> scrape --help into doc-model JSON | |
| # -> render .adoc -> upload artifact. | |
| # | |
| # NOTE: this generates and publishes the docs as an artifact only; landing them | |
| # in the docs site is a separate step for now and may be automated later. | |
| # ============================================================================= | |
| name: Publish API docs | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read | |
| env: | |
| ADOC_PREFIX: cli | |
| jobs: | |
| generate: | |
| runs-on: codebuild-agentcore-e2e-${{ github.run_id }}-${{ github.run_attempt }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Set up Node | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '20' | |
| - name: Install the latest CLI version | |
| run: npm install -g @aws/agentcore@latest | |
| - name: Read CLI version | |
| id: ver | |
| run: echo "version=$(agentcore --version)" >> "$GITHUB_OUTPUT" | |
| - name: Extract doc-model JSON (scrape --help for all commands) | |
| run: | | |
| node scripts/extract-cli-model.mjs \ | |
| --out doc-model.json \ | |
| --version "${{ steps.ver.outputs.version }}" | |
| - name: Render .adoc | |
| run: | | |
| python3 scripts/render_adoc.py \ | |
| --model doc-model.json \ | |
| --out-dir out/adoc \ | |
| --prefix "${ADOC_PREFIX}" | |
| - name: Upload API-docs artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: api-docs-adoc | |
| path: out/adoc | |
| if-no-files-found: error |