-
Notifications
You must be signed in to change notification settings - Fork 18
.github, docs/jobs: update GitHub workflow and pre-build job #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
fcaecec
2e8793f
ff2219d
fb59803
30cbe19
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # SPDX-FileCopyrightText: 2026 Canonical Ltd | ||
| # SPDX-License-Identifier: GPL-3.0-only | ||
|
|
||
| name: Prepare the REST OpenAPI Specification | ||
| on: | ||
| repository_dispatch: | ||
| types: [api-updated] | ||
|
|
||
| jobs: | ||
| process-specification: | ||
| runs-on: ubuntu-latest | ||
| name: Bundle REST API documentation | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| repository: canonical/snapd | ||
| path: ./snapd | ||
| fetch-depth: 0 | ||
| ref: master | ||
|
|
||
| - name: Check Licensing/Copyright Compliance | ||
| uses: docker://fsfe/reuse | ||
| with: | ||
| entrypoint: /bin/sh | ||
| args: -c "cd docs/api && reuse lint" | ||
|
|
||
| - name: Lint API specification | ||
| uses: docker://redocly/cli | ||
| with: | ||
| args: lint ./docs/api/openapi.yaml | ||
|
|
||
| - name: Bundle OpenAPI to JSON | ||
| uses: docker://redocly/cli | ||
| with: | ||
| args: bundle ./docs/api/openapi.yaml --output ./docs/api/openapi.json --ext json | ||
|
|
||
| - name: Store generated JSON artifact | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: openapi-spec | ||
| path: docs/api/openapi.json | ||
|
|
||
| #- name: Trigger RTD build | ||
| # run: | | ||
| # curl -X POST -H "Authorization: Bearer ${{ secrets.RTD_PAT }}" \ | ||
| # https://read-the-docs.com \ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,9 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Configuration | ||
| REPO="canonical/snapd" | ||
| # Ensure this matches the actual filename of your YAML workflow in the snapd repo | ||
| WORKFLOW="build-documentation.yaml" | ||
| ARTIFACT_NAME="openapi-spec" # Updated to match the new GitHub Action output | ||
| REPO="canonical/snap-docs" | ||
| WORKFLOW="build-rest-api.yml" | ||
| ARTIFACT_NAME="openapi-spec" | ||
| TARGET_DIR="${SOURCEDIR}/_html_extra/reference/api" | ||
|
|
||
| mkdir -p "${TARGET_DIR}" | ||
|
|
@@ -15,6 +14,7 @@ RUN_IDS=$(gh run list \ | |
| -R "${REPO}" \ | ||
| --workflow "${WORKFLOW}" \ | ||
| --status success \ | ||
| --branch master \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on https://github.com/canonical/snap-docs/pull/199/changes#r2958816628 if we can directly generate the artifact here, we could remove this search from here. But if keep it, note that this should not be |
||
| --limit 100 \ | ||
| --json databaseId \ | ||
| -q '.[].databaseId') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you named your workflow with underscores instead of hyphens