Skip to content

Commit 493b1bf

Browse files
author
Guy Bedford
committed
Merge remote-tracking branch 'spec/main'
2 parents 20e6082 + 05949f5 commit 493b1bf

29 files changed

+625
-180
lines changed

.github/workflows/ci-interpreter.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Checkout repo
20-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
2121
- name: Setup OCaml
22-
uses: ocaml/setup-ocaml@v2
22+
uses: ocaml/setup-ocaml@v3
2323
with:
24-
ocaml-compiler: 4.12.x
24+
ocaml-compiler: 4.14.x
2525
- name: Setup OCaml tools
2626
run: opam install --yes ocamlfind.1.9.5 js_of_ocaml.4.0.0 js_of_ocaml-ppx.4.0.0
2727
- name: Setup Node.js
28-
uses: actions/setup-node@v2
28+
uses: actions/setup-node@v4
2929
with:
3030
node-version: 19.x
3131
- name: Build interpreter

.github/workflows/ci-spec.yml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Checkout repo
20-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
2121
with:
2222
submodules: "recursive"
2323
- name: Setup Node.js
24-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@v4
2525
with:
2626
node-version: 16
2727
- name: Setup Bikeshed
@@ -35,7 +35,7 @@ jobs:
3535
- name: Run Bikeshed
3636
run: cd document/core && make bikeshed
3737
- name: Upload artifact
38-
uses: actions/upload-artifact@v2
38+
uses: actions/upload-artifact@v4
3939
with:
4040
name: core-rendered
4141
path: document/core/_build/html
@@ -44,13 +44,13 @@ jobs:
4444
runs-on: ubuntu-latest
4545
steps:
4646
- name: Checkout repo
47-
uses: actions/checkout@v2
47+
uses: actions/checkout@v4
4848
- name: Setup Bikeshed
4949
run: pip install bikeshed && bikeshed update
5050
- name: Run Bikeshed
5151
run: bikeshed spec "document/js-api/index.bs" "document/js-api/index.html"
5252
- name: Upload artifact
53-
uses: actions/upload-artifact@v2
53+
uses: actions/upload-artifact@v4
5454
with:
5555
name: js-api-rendered
5656
path: document/js-api/index.html
@@ -59,43 +59,59 @@ jobs:
5959
runs-on: ubuntu-latest
6060
steps:
6161
- name: Checkout repo
62-
uses: actions/checkout@v2
62+
uses: actions/checkout@v4
6363
- name: Setup Bikeshed
6464
run: pip install bikeshed && bikeshed update
6565
- name: Run Bikeshed
6666
run: bikeshed spec "document/web-api/index.bs" "document/web-api/index.html"
6767
- name: Upload artifact
68-
uses: actions/upload-artifact@v2
68+
uses: actions/upload-artifact@v4
6969
with:
7070
name: web-api-rendered
7171
path: document/web-api/index.html
7272

73+
build-spec-versions:
74+
runs-on: ubuntu-latest
75+
steps:
76+
- name: Checkout repo
77+
uses: actions/checkout@v4
78+
- name: Upload artifacts
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: versions-rendered
82+
path: document/versions/
83+
7384
publish-spec:
7485
runs-on: ubuntu-latest
75-
needs: [build-core-spec, build-js-api-spec, build-web-api-spec]
86+
needs: [build-core-spec, build-js-api-spec, build-web-api-spec, build-spec-versions]
7687
steps:
7788
- name: Checkout repo
78-
uses: actions/checkout@v2
89+
uses: actions/checkout@v4
7990
- name: Create output directory
8091
run: mkdir _output && cp document/index.html _output/index.html
8192
- name: Download core spec artifact
82-
uses: actions/download-artifact@v2
93+
uses: actions/download-artifact@v4
8394
with:
8495
name: core-rendered
8596
path: _output/core
8697
- name: Download JS API spec artifact
87-
uses: actions/download-artifact@v2
98+
uses: actions/download-artifact@v4
8899
with:
89100
name: js-api-rendered
90101
path: _output/js-api
91102
- name: Download Web API spec artifact
92-
uses: actions/download-artifact@v2
103+
uses: actions/download-artifact@v4
93104
with:
94105
name: web-api-rendered
95106
path: _output/web-api
107+
- name: Download spec versions artifacts
108+
uses: actions/download-artifact@v4
109+
with:
110+
name: versions-rendered
111+
path: _output/versions
96112
- name: Publish to GitHub Pages
97113
if: github.ref == 'refs/heads/main'
98-
uses: peaceiris/actions-gh-pages@v3
114+
uses: peaceiris/actions-gh-pages@v4
99115
with:
100116
publish_dir: ./_output
101117
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/w3c-publish.yml

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,76 @@
1-
name: Publish to W3C TR space
1+
name: Validate/Publish to W3C TR space
22

33
on:
44
push:
55
branches: [ main ]
66
paths: [ .github/**, document/** ]
7+
pull_request:
8+
paths: [ .github/**, document/** ]
79

8-
# Allows you to run this workflow manually from the Actions tab
10+
# Allows you to run this workflow manually from the Actions tab, gh CLI tool,
11+
# or REST API. THe w3c-status options correspond to the valid options for
12+
# Bikeshed's --md-status flag, and refer to the W3C rec-track document
13+
# stages described in https://www.w3.org/policies/process/#maturity-stages
14+
# (Editor's Draft, Working Draft, Candidiate Recommendation Draft, and
15+
# Candidate Recommendation Snapshot).
916
workflow_dispatch:
1017
inputs:
18+
dry-run:
19+
required: true
20+
type: boolean
21+
description: If set, Echidna will validate but not publish.
1122
w3c-status:
1223
required: true
13-
type: string
24+
type: choice
25+
description: W3C Document Status
26+
options:
27+
- ED
28+
- WD
29+
- CRD
30+
- CR
31+
32+
env:
33+
YARN_ENABLE_IMMUTABLE_INSTALLS: false
34+
W3C_STATUS: ${{ github.event_name == 'workflow_dispatch' && inputs.w3c-status || 'CRD' }}
1435

1536
jobs:
1637
publish-to-w3c-TR:
17-
if: github.repository == 'WebAssembly/spec'
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
spec: [core, js-api, web-api]
1842
runs-on: ubuntu-latest
1943
steps:
2044
- name: Checkout repo
21-
uses: actions/checkout@v2
45+
uses: actions/checkout@v4
2246
with:
2347
submodules: "recursive"
2448
- name: Setup Node.js
25-
uses: actions/setup-node@v3
49+
uses: actions/setup-node@v4
2650
with:
2751
node-version: 16
2852
- name: Setup Bikeshed
2953
run: pip install bikeshed && bikeshed update
3054
- name: Setup TexLive
55+
if: ${{ matrix.spec == 'core' }}
3156
run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
3257
- name: Setup Sphinx
58+
if: ${{ matrix.spec == 'core' }}
3359
run: pip install six && pip install sphinx==5.1.0
34-
- name: Publish all specs to their https://www.w3.org/TR/ URLs
35-
run: cd document && make -e WD-echidna-CI
60+
- name: Publish ${{ matrix.spec }} spec to its https://www.w3.org/TR/ URL
61+
if: env.W3C_ECHIDNA_TOKEN_CORE
62+
run: cd document && make -e -C ${{ matrix.spec }} WD-echidna-CI
3663
env:
37-
W3C_STATUS: ${{ github.event_name == 'push' && 'WD' || inputs.w3c-status }}
3864
W3C_ECHIDNA_TOKEN_CORE: ${{ secrets.W3C_ECHIDNA_TOKEN_CORE }}
3965
W3C_ECHIDNA_TOKEN_JSAPI: ${{ secrets.W3C_ECHIDNA_TOKEN_JSAPI }}
4066
W3C_ECHIDNA_TOKEN_WEBAPI: ${{ secrets.W3C_ECHIDNA_TOKEN_WEBAPI }}
41-
YARN_ENABLE_IMMUTABLE_INSTALLS: false
67+
# Publish the draft on manual dispatches without dry-run set, or on pushes to the main branch.
68+
ECHIDNA_DRYRUN: |-
69+
${{ !((github.event_name == 'workflow_dispatch' && !inputs.dry-run) ||
70+
(github.event_name == 'push' && github.repository == 'WebAssembly/spec' && github.ref == 'refs/heads/main')) }}
71+
- name: Validate ${{ matrix.spec }} spec with Echidna
72+
if: env.W3C_USERNAME
73+
run: cd document && make -e -C ${{ matrix.spec }} WD-echidna
74+
env:
75+
W3C_USERNAME: ${{ secrets.W3C_USERNAME }}
76+
W3C_PASSWORD: ${{ secrets.W3C_PASSWORD }}

document/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DIRS = js-api web-api core
1+
DIRS = js-api web-api core versions
22
FILES = index.html
33
BUILDDIR = _build
44
TAR = tar
@@ -60,7 +60,7 @@ $(DIRS:%=build-%): build-%:
6060
(cd $(@:build-%=%); make BUILDDIR=$(BUILDDIR) all)
6161

6262
.PHONY: $(DIRS:%=dir-%)
63-
$(DIRS:%=dir-%): dir-%:
63+
$(DIRS:%=dir-%): dir-%: $(BUILDDIR)
6464
mkdir -p $(BUILDDIR)/$(@:dir-%=%)
6565
rm -rf $(BUILDDIR)/$(@:dir-%=%)/*
6666
cp -R $(@:dir-%=%)/$(BUILDDIR)/html/* $(BUILDDIR)/$(@:dir-%=%)/

document/core/Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ NAME = WebAssembly
1313
DECISION_URL = https://github.com/WebAssembly/meetings/blob/main/main/2024/WG-06-12.md
1414
TAR = tar
1515
DEADLINE = $(shell date -d "+30 days" +%Y-%m-%d 2>/dev/null || date -v +30d +%Y-%m-%d)
16+
ECHIDNA_DRYRUN = true
1617

1718
# Internal variables.
1819
PAPEROPT_a4 = -D latex_paper_size=a4
@@ -196,9 +197,11 @@ WD-echidna: WD-tar
196197
curl 'https://labs.w3.org/echidna/api/request' \
197198
--user '$(W3C_USERNAME):$(W3C_PASSWORD)' \
198199
-F "tar=@$(BUILDDIR)/WD.tar" \
199-
-F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt
200+
-F "decision=$(DECISION_URL)" \
201+
-F "dry-run=$(ECHIDNA_DRYRUN)" | tee $(BUILDDIR)/WD-echidna-id.txt
202+
python3 ../util/check-echidna-status.py $(BUILDDIR)
200203
@echo
201-
@echo "Published $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
204+
@echo "Uploaded $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
202205

203206
.PHONY: WD-echidna-CI
204207
WD-echidna-CI: WD-tar
@@ -210,9 +213,11 @@ WD-echidna-CI: WD-tar
210213
curl 'https://labs.w3.org/echidna/api/request' \
211214
-F "tar=@$(BUILDDIR)/WD.tar" \
212215
-F "token=$(W3C_ECHIDNA_TOKEN_CORE)" \
213-
-F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt
216+
-F "decision=$(DECISION_URL)" \
217+
-F "dry-run=$(ECHIDNA_DRYRUN)" | tee $(BUILDDIR)/WD-echidna-id.txt
218+
python3 ../util/check-echidna-status.py $(BUILDDIR)
214219
@echo
215-
@echo "Published $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
220+
@echo "Uploaded $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
216221

217222
.PHONY: diff
218223
diff: bikeshed

0 commit comments

Comments
 (0)