Skip to content

Commit fffad73

Browse files
dschuffMs2ger
authored andcommitted
Update Makefiles for easier generation of different document status
This is derived from #1764 but does not actually change the publication status by default locally or on CI (ED is the default, and the w3c echidna publication action overrides it to WD). It also includes a fix to the echidna Makefile rules to exit with an error in case an underlying step returns an error.
1 parent 5f7ae48 commit fffad73

File tree

5 files changed

+19
-16
lines changed

5 files changed

+19
-16
lines changed

.github/workflows/w3c-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Publish all specs to their https://www.w3.org/TR/ URLs
3131
run: cd document && make -e WD-echidna-CI
3232
env:
33-
STATUS: --md-status=WD
33+
W3C_STATUS: WD
3434
W3C_ECHIDNA_TOKEN_CORE: ${{ secrets.W3C_ECHIDNA_TOKEN_CORE }}
3535
W3C_ECHIDNA_TOKEN_JSAPI: ${{ secrets.W3C_ECHIDNA_TOKEN_JSAPI }}
3636
W3C_ECHIDNA_TOKEN_WEBAPI: ${{ secrets.W3C_ECHIDNA_TOKEN_WEBAPI }}

document/Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ diff: $(DIRS:%=diff-%)
2828
# macOS: do “brew install tar” & run “make” as: TAR=gtar make -e WD-tar
2929
.PHONY: WD-tar
3030
WD-tar:
31-
for dir in $(DIRS); \
32-
do STATUS=--md-status=WD TAR=$(TAR) $(MAKE) -e -C $$dir $@;\
31+
for dir in $(DIRS); do \
32+
TAR=$(TAR) $(MAKE) -e -C $$dir $@ || exit 1; \
3333
done
3434

3535
# macOS: do “brew install tar” & run “make” as: TAR=gtar make -e WD-echidna
3636
.PHONY: WD-echidna
3737
WD-echidna:
38-
for dir in $(DIRS); \
39-
do $(MAKE) -e -C $$dir $@;\
38+
for dir in $(DIRS); do \
39+
$(MAKE) -e -C $$dir $@ || exit 1; \
4040
done
4141

4242
.PHONY: WD-echidna-CI
4343
WD-echidna-CI:
44-
for dir in $(DIRS); \
45-
do $(MAKE) -e -C $$dir $@;\
44+
for dir in $(DIRS); do \
45+
$(MAKE) -e -C $$dir $@ || exit 1; \
4646
done
4747

4848
# Directory-specific targets.

document/core/Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33

44
# You can set these variables from the command line.
5+
W3C_STATUS = ED
56
SPHINXOPTS =
67
SPHINXBUILD = sphinx-build
78
PAPER = a4
@@ -154,7 +155,7 @@ bikeshed: $(GENERATED)
154155
@echo
155156
@echo =========================================================================
156157
mkdir -p $(BUILDDIR)/bikeshed_mathjax/
157-
bikeshed spec $(STATUS) index.bs $(BUILDDIR)/bikeshed_mathjax/index.html
158+
bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/bikeshed_mathjax/index.html
158159
mkdir -p $(BUILDDIR)/html/bikeshed/
159160
(cd util/katex/ && yarn && yarn build && npm install --only=prod)
160161
python3 util/mathjax2katex.py $(BUILDDIR)/bikeshed_mathjax/index.html \
@@ -196,7 +197,7 @@ WD-echidna: WD-tar
196197
-F "tar=@$(BUILDDIR)/WD.tar" \
197198
-F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt
198199
@echo
199-
@echo "Published working draft. Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
200+
@echo "Published $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
200201

201202
.PHONY: WD-echidna-CI
202203
WD-echidna-CI: WD-tar
@@ -210,7 +211,7 @@ WD-echidna-CI: WD-tar
210211
-F "token=$(W3C_ECHIDNA_TOKEN_CORE)" \
211212
-F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt
212213
@echo
213-
@echo "Published working draft. Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
214+
@echo "Published $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
214215

215216
.PHONY: diff
216217
diff: bikeshed

document/js-api/Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
W3C_STATUS = ED
12
BUILDDIR = _build
23
STATICDIR = _static
34
DOWNLOADDIR = _download
@@ -8,7 +9,7 @@ TAR = tar
89
.PHONY: all
910
all:
1011
mkdir -p $(BUILDDIR)/html
11-
bikeshed spec index.bs $(BUILDDIR)/html/index.html
12+
bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/html/index.html
1213
@echo "Build finished. The HTML pages are in `pwd`/$(BUILDDIR)/html."
1314

1415
.PHONY: publish
@@ -33,7 +34,7 @@ diff: all
3334
# macOS tar has no “--transform” option (only GNU tar does), so on macOS,
3435
# do “brew install tar” & run “make” like this: “TAR=gtar make -e WD-tar”
3536
WD-tar: all
36-
bikeshed spec --md-status=WD index.bs $(BUILDDIR)/html/index.html
37+
bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/html/index.html
3738
$(TAR) -C $(BUILDDIR)/html --transform="s/index.html/Overview.html/" -cf $(BUILDDIR)/WD.tar index.html
3839
@echo "Built $(BUILDDIR)/WD.tar."
3940

@@ -62,4 +63,4 @@ WD-echidna-CI: WD-tar
6263
-F "token=$(W3C_ECHIDNA_TOKEN_JSAPI)" \
6364
-F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt
6465
@echo
65-
@echo "Published working draft. Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
66+
@echo "Published w$(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"

document/web-api/Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
W3C_STATUS = ED
12
BUILDDIR = _build
23
STATICDIR = _static
34
DOWNLOADDIR = _download
@@ -8,7 +9,7 @@ TAR = tar
89
.PHONY: all
910
all:
1011
mkdir -p $(BUILDDIR)/html
11-
bikeshed spec index.bs $(BUILDDIR)/html/index.html
12+
bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/html/index.html
1213
@echo "Build finished. The HTML pages are in `pwd`/$(BUILDDIR)/html."
1314

1415
.PHONY: publish
@@ -33,7 +34,7 @@ diff: all
3334
# macOS tar has no “--transform” option (only GNU tar does), so on macOS,
3435
# do “brew install tar” & run “make” like this: “TAR=gtar make -e WD-tar”
3536
WD-tar: all
36-
bikeshed spec --md-status=WD index.bs $(BUILDDIR)/html/index.html
37+
bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/html/index.html
3738
$(TAR) -C $(BUILDDIR)/html --transform="s/index.html/Overview.html/" -cf $(BUILDDIR)/WD.tar index.html
3839
@echo "Built $(BUILDDIR)/WD.tar."
3940

@@ -62,4 +63,4 @@ WD-echidna-CI: WD-tar
6263
-F "token=$(W3C_ECHIDNA_TOKEN_WEBAPI)" \
6364
-F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt
6465
@echo
65-
@echo "Published working draft. Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
66+
@echo "Published $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"

0 commit comments

Comments
 (0)