Skip to content

Commit 631ef56

Browse files
committed
CI: fix schema publishing.
Previously, two concurrent jobs were used, which caused a race condition. Serialize them.
1 parent 496432e commit 631ef56

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

.github/workflows/main.yaml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -162,30 +162,6 @@ jobs:
162162
steps:
163163
- run: ${{ contains(needs.*.result, 'failure') && 'false' || 'true' }}
164164

165-
publish-schemas:
166-
needs: document
167-
if: ${{ github.repository == 'amaranth-lang/amaranth' }}
168-
runs-on: ubuntu-latest
169-
steps:
170-
- name: Check out source code
171-
uses: actions/checkout@v4
172-
with:
173-
fetch-depth: 0
174-
- name: Download schema archive
175-
uses: actions/download-artifact@v4
176-
with:
177-
name: schema
178-
path: schema/
179-
- name: Publish development schemas
180-
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
181-
uses: JamesIves/github-pages-deploy-action@releases/v4
182-
with:
183-
repository-name: amaranth-lang/amaranth-lang.github.io
184-
ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }}
185-
branch: main
186-
folder: schema/
187-
target-folder: schema/amaranth/
188-
189165
publish-docs:
190166
needs: document
191167
if: ${{ github.repository == 'amaranth-lang/amaranth' }}
@@ -242,6 +218,30 @@ jobs:
242218
folder: pages/
243219
clean: false
244220

221+
publish-schemas:
222+
needs: [required, publish-docs] # avoid race condition with publish-docs
223+
if: ${{ github.repository == 'amaranth-lang/amaranth' }}
224+
runs-on: ubuntu-latest
225+
steps:
226+
- name: Check out source code
227+
uses: actions/checkout@v4
228+
with:
229+
fetch-depth: 0
230+
- name: Download schema archive
231+
uses: actions/download-artifact@v4
232+
with:
233+
name: schema
234+
path: schema/
235+
- name: Publish schemas
236+
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
237+
uses: JamesIves/github-pages-deploy-action@releases/v4
238+
with:
239+
repository-name: amaranth-lang/amaranth-lang.github.io
240+
ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }}
241+
branch: main
242+
folder: schema/
243+
target-folder: schema/amaranth/
244+
245245
publish-package:
246246
needs: required
247247
runs-on: ubuntu-latest

amaranth/lib/meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def _extract_schemas(package, *, base_uri, path="schema/"):
135135
entry_points = distribution(package).entry_points
136136
for entry_point in entry_points.select(group="amaranth.lib.meta"):
137137
schema = entry_point.load().schema
138-
relative_path = entry_point.name # v0.5/component.json
138+
relative_path = entry_point.name # "0.5/component.json"
139139
schema_filename = pathlib.Path(path) / relative_path
140140
assert schema["$id"] == f"{base_uri}/{relative_path}", \
141141
f"Schema $id {schema['$id']} must be {base_uri}/{relative_path}"

0 commit comments

Comments
 (0)