diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d3a361b..5ff9a64 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -162,30 +162,6 @@ jobs: steps: - run: ${{ contains(needs.*.result, 'failure') && 'false' || 'true' }} - publish-schemas: - needs: document - if: ${{ github.repository == 'amaranth-lang/amaranth' }} - runs-on: ubuntu-latest - steps: - - name: Check out source code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Download schema archive - uses: actions/download-artifact@v4 - with: - name: schema - path: schema/ - - name: Publish development schemas - if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }} - uses: JamesIves/github-pages-deploy-action@releases/v4 - with: - repository-name: amaranth-lang/amaranth-lang.github.io - ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }} - branch: main - folder: schema/ - target-folder: schema/amaranth/ - publish-docs: needs: document if: ${{ github.repository == 'amaranth-lang/amaranth' }} @@ -242,6 +218,30 @@ jobs: folder: pages/ clean: false + publish-schemas: + needs: [required, publish-docs] # avoid race condition with publish-docs + if: ${{ github.repository == 'amaranth-lang/amaranth' }} + runs-on: ubuntu-latest + steps: + - name: Check out source code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Download schema archive + uses: actions/download-artifact@v4 + with: + name: schema + path: schema/ + - name: Publish schemas + if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }} + uses: JamesIves/github-pages-deploy-action@releases/v4 + with: + repository-name: amaranth-lang/amaranth-lang.github.io + ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }} + branch: main + folder: schema/ + target-folder: schema/amaranth/ + publish-package: needs: required runs-on: ubuntu-latest diff --git a/amaranth/lib/meta.py b/amaranth/lib/meta.py index 84c6afa..b005557 100644 --- a/amaranth/lib/meta.py +++ b/amaranth/lib/meta.py @@ -135,7 +135,7 @@ def _extract_schemas(package, *, base_uri, path="schema/"): entry_points = distribution(package).entry_points for entry_point in entry_points.select(group="amaranth.lib.meta"): schema = entry_point.load().schema - relative_path = entry_point.name # v0.5/component.json + relative_path = entry_point.name # "0.5/component.json" schema_filename = pathlib.Path(path) / relative_path assert schema["$id"] == f"{base_uri}/{relative_path}", \ f"Schema $id {schema['$id']} must be {base_uri}/{relative_path}"