diff --git a/.github/workflows/ci-spec.yml b/.github/workflows/ci-spec.yml index e88a224d61..1e3f188a34 100644 --- a/.github/workflows/ci-spec.yml +++ b/.github/workflows/ci-spec.yml @@ -99,3 +99,29 @@ jobs: with: publish_dir: ./_output github_token: ${{ secrets.GITHUB_TOKEN }} + + publish-to-w3c-TR: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + submodules: "recursive" + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Setup Bikeshed + run: pip install bikeshed && bikeshed update + - name: Setup TexLive + run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended + - name: Setup Sphinx + run: pip install six && pip install sphinx==5.1.0 + - name: Publish all specs to their https://www.w3.org/TR/ URLs + run: cd document && make -e WD-echidna-CI + env: + STATUS: --md-status=WD + W3C_ECHIDNA_TOKEN_CORE: ${{ secrets.W3C_ECHIDNA_TOKEN_CORE }} + W3C_ECHIDNA_TOKEN_JSAPI: ${{ secrets.W3C_ECHIDNA_TOKEN_JSAPI }} + W3C_ECHIDNA_TOKEN_WEBAPI: ${{ secrets.W3C_ECHIDNA_TOKEN_WEBAPI }} + YARN_ENABLE_IMMUTABLE_INSTALLS: false diff --git a/document/Makefile b/document/Makefile index 875efc7206..01a6d93423 100644 --- a/document/Makefile +++ b/document/Makefile @@ -1,6 +1,7 @@ -DIRS = core js-api web-api +DIRS = js-api web-api core FILES = index.html BUILDDIR = _build +TAR = tar # Global targets. @@ -24,6 +25,25 @@ clean: $(DIRS:%=clean-%) .PHONY: diff diff: $(DIRS:%=diff-%) +# macOS: do “brew install tar” & run “make” as: TAR=gtar make -e WD-tar +.PHONY: WD-tar +WD-tar: + for dir in $(DIRS); \ + do STATUS=--md-status=WD TAR=$(TAR) $(MAKE) -e -C $$dir $@;\ + done + +# macOS: do “brew install tar” & run “make” as: TAR=gtar make -e WD-echidna +.PHONY: WD-echidna +WD-echidna: + for dir in $(DIRS); \ + do $(MAKE) -e -C $$dir $@;\ + done + +.PHONY: WD-echidna-CI +WD-echidna-CI: + for dir in $(DIRS); \ + do $(MAKE) -e -C $$dir $@;\ + done # Directory-specific targets. diff --git a/document/core/Makefile b/document/core/Makefile index 8a3650ec98..74c9daeea6 100644 --- a/document/core/Makefile +++ b/document/core/Makefile @@ -9,6 +9,8 @@ BUILDDIR = _build STATICDIR = _static DOWNLOADDIR = _download NAME = WebAssembly +DECISION_URL = https://github.com/WebAssembly/meetings/blob/main/main/2017/WG-12-06.md +TAR = tar # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 @@ -148,7 +150,7 @@ bikeshed: $(GENERATED) @echo @echo ========================================================================= mkdir -p $(BUILDDIR)/bikeshed_mathjax/ - bikeshed spec index.bs $(BUILDDIR)/bikeshed_mathjax/index.html + bikeshed spec $(STATUS) index.bs $(BUILDDIR)/bikeshed_mathjax/index.html mkdir -p $(BUILDDIR)/html/bikeshed/ (cd util/katex/ && yarn && yarn build && npm install --only=prod) python3 util/mathjax2katex.py $(BUILDDIR)/bikeshed_mathjax/index.html \ @@ -163,9 +165,11 @@ bikeshed: $(GENERATED) @echo "Build finished. The HTML page is in $(BUILDDIR)/html/bikeshed/." .PHONY: WD-tar +# macOS tar has no “--transform” option (only GNU tar does), so on macOS, +# do “brew install tar” & run “make” like this: “TAR=gtar make -e WD-tar” WD-tar: bikeshed @echo "Building tar file..." - tar cvf \ + $(TAR) cvf \ $(BUILDDIR)/WD.tar \ --transform='s|$(BUILDDIR)/html/bikeshed/||' \ --transform='s|index.html|Overview.html|' \ @@ -190,6 +194,20 @@ WD-echidna: WD-tar @echo @echo "Published working draft. Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`" +.PHONY: WD-echidna-CI +WD-echidna-CI: WD-tar + @if [ -z $(W3C_ECHIDNA_TOKEN_CORE) ] || \ + [ -z $(DECISION_URL) ] ; then \ + echo "Must provide W3C_ECHIDNA_TOKEN_CORE and DECISION_URL environment variables"; \ + exit 1; \ + fi + curl 'https://labs.w3.org/echidna/api/request' \ + -F "tar=@$(BUILDDIR)/WD.tar" \ + -F "token=$(W3C_ECHIDNA_TOKEN_CORE)" \ + -F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt + @echo + @echo "Published working draft. Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`" + .PHONY: diff diff: bikeshed @echo "Downloading the old single-file html spec..." diff --git a/document/core/index.bs b/document/core/index.bs index 178c1437c5..830c0595c8 100644 --- a/document/core/index.bs +++ b/document/core/index.bs @@ -3,14 +3,16 @@ Title: WebAssembly Core Specification Shortname: wasm-core Group: wasm Status: ED +Issue Tracking: GitHub https://github.com/WebAssembly/spec/issues Level: 2 TR: https://www.w3.org/TR/wasm-core-2/ ED: https://webassembly.github.io/spec/core/bikeshed/ -Editor: Andreas Rossberg +Editor: Andreas Rossberg, w3cid 82328 Repository: WebAssembly/spec Markup Shorthands: css no, markdown no, algorithm no, idl no Abstract: This document describes release 2.0 of the core WebAssembly standard, a safe, portable, low-level code format designed for efficient execution and compact representation. Prepare For TR: true +Date: now
diff --git a/document/core/util/bikeshed_fixup.py b/document/core/util/bikeshed_fixup.py
index 568c67b575..7041d875de 100755
--- a/document/core/util/bikeshed_fixup.py
+++ b/document/core/util/bikeshed_fixup.py
@@ -3,6 +3,7 @@
 
 import os
 import sys
+import re
 
 
 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
@@ -63,6 +64,28 @@ def Main():
       "[[!IEEE-754-2019]]"
   )
 
+  # Fix this problem that causes an  element to be generated in the output
+  # as a child of another  element, and for which the HTML validator reports
+  # an error — which in turn causes the W3C pubrules checker to refuse to
+  # autopublish the resulting bikeshed output.
+  data = data.replace(
+      """\href{#binary-sint}{\href{#syntax-int}""",
+      """{\href{#syntax-int}""")
+
+  # Strip the entire  element from the the sphinx output — because it
+  # contains several ,