Skip to content

Commit 0360be2

Browse files
authored
Merge pull request #23 from nuttycom/fix-render-site
Fix render site
2 parents 893a75a + 1b3947b commit 0360be2

156 files changed

Lines changed: 90 additions & 30990 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/render-site.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Inspired by https://nathan-at-least.github.io/auto-deploy-howto.html
2+
name: Deploy Rendered Site
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: write
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
render-and-deploy:
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4.1.7
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Setup Pages
34+
uses: actions/configure-pages@v5
35+
36+
# Each deploy overwrites the contents of `publish` branch from
37+
# `main`, but also introduces a merge structure so that the history of
38+
# `publish` is tracked:
39+
- name: Overwrite publish branch with main branch
40+
run: |
41+
set -x
42+
BASE_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
43+
git config --global user.name 'autodeploy'
44+
git config --global user.email 'autodeploy'
45+
TMP='local-temp-branch'
46+
git checkout -b "$TMP" "$BASE_BRANCH" # Same tree state as main branch
47+
git merge origin/publish \
48+
--commit -m 'Auto-deploy: merging "main" branch'
49+
git checkout publish
50+
git merge --ff-only "$TMP"
51+
git branch -d "$TMP"
52+
53+
- name: Compile ZIPs and Zcash Protocol Specification
54+
uses: ./.github/actions/render
55+
56+
- name: Commit and Push to "publish" branch
57+
uses: EndBug/add-and-commit@v9.1.4
58+
with:
59+
add: 'rendered'
60+
default_author: github_actions
61+
62+
- name: Upload artifact
63+
uses: actions/upload-pages-artifact@v3
64+
with:
65+
path: 'rendered'
66+
67+
- name: Deploy to GitHub Pages
68+
id: deployment
69+
uses: actions/deploy-pages@v4

.github/workflows/render.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ MultiMarkdown-6
3030

3131
protocol/aux/
3232
protocol/protocol.ver
33+
34+
rendered/

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ RUN pip install 'docutils==0.21.2' 'rst2html5==2.0.1'
2222

2323
RUN git config --global --add safe.directory /zips
2424

25-
# Use a fork so that we're running pinned code.
26-
RUN git clone -b develop https://github.com/Electric-Coin-Company/MultiMarkdown-6 && cd MultiMarkdown-6 && make release && cd build && make && make install
25+
# Use a fork so that we're running pinned code. The Makefile for
26+
# MultiMarkdown-6 expects the `master` branch to exist for delta computation,
27+
# so we also add that branch locally, even though it's otherwise unused.
28+
RUN git clone -b develop https://github.com/Electric-Coin-Company/MultiMarkdown-6 && \
29+
cd MultiMarkdown-6 && \
30+
git branch master origin/master && \
31+
make release && cd build && make && make install
2732

2833
ENV PATH=${PATH}:/root/.local/bin
2934

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ all-zips: .Makefile.uptodate
1010
echo "$(patsubst zips/%,%,$(sort $(wildcard zips/draft-*.rst) $(wildcard zips/draft-*.md)))" >.draftfilelist.new
1111
diff .draftfilelist.current .draftfilelist.new || cp -f .draftfilelist.new .draftfilelist.current
1212
rm -f .draftfilelist.new
13+
mkdir -p rendered
14+
cp -r static/* rendered/
1315
$(MAKE) README.rst
1416
$(MAKE) rendered/index.html $(addprefix rendered/,$(addsuffix .html,$(basename $(patsubst zips/%,%,$(sort $(wildcard zips/*.rst) $(wildcard zips/*.md))))))
1517

@@ -31,7 +33,8 @@ all-specs: all-zips
3133
$(MAKE) -C protocol all-specs
3234

3335
discard:
34-
git checkout -- 'rendered/*.html' 'README.rst' 'rendered/protocol/*.pdf'
36+
rm -r rendered
37+
git checkout -- 'README.rst'
3538

3639
.Makefile.uptodate: Makefile render.sh
3740
$(MAKE) clean

docs

Lines changed: 0 additions & 1 deletion
This file was deleted.

protocol/Makefile

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,6 @@ protocol-dark: $(PDFDIR)/protocol-dark.pdf
3131
all-specs: .Makefile.uptodate
3232
$(MAKE) nu6 nu6-dark nu5 canopy heartwood blossom sapling
3333

34-
tag-release:
35-
ifeq ($(shell git tag --points-at HEAD |wc -l),0)
36-
echo "Set a tag at HEAD first."
37-
else
38-
$(eval TAG := $(shell git tag --points-at HEAD))
39-
git fetch origin
40-
git merge-base --is-ancestor origin/main HEAD || (echo "The current branch is dirty and/or not up-to-date with origin's main branch."; false)
41-
$(MAKE) clean all
42-
git add $(PDFDIR)/*.pdf
43-
git commit -m "Regenerate PDFs." $(PDFDIR)/*.pdf
44-
git tag "v$(TAG)"
45-
endif
46-
4734
discard:
4835
git checkout -- "$(PDFDIR)/*.pdf"
4936

@@ -82,6 +69,7 @@ auxsapling:
8269

8370
sapling:
8471
$(MAKE) auxsapling
72+
mkdir -p $(PDFDIR)
8573
mv -f aux/sapling.pdf $(PDFDIR)
8674

8775
.PHONY: auxblossom blossom
@@ -94,6 +82,7 @@ auxblossom:
9482

9583
blossom:
9684
$(MAKE) auxblossom
85+
mkdir -p $(PDFDIR)
9786
mv -f aux/blossom.pdf $(PDFDIR)
9887

9988
.PHONY: auxheartwood heartwood
@@ -106,6 +95,7 @@ auxheartwood:
10695

10796
heartwood:
10897
$(MAKE) auxheartwood
98+
mkdir -p $(PDFDIR)
10999
mv -f aux/heartwood.pdf $(PDFDIR)
110100

111101
.PHONY: auxcanopy canopy
@@ -118,6 +108,7 @@ auxcanopy:
118108

119109
canopy:
120110
$(MAKE) auxcanopy
111+
mkdir -p $(PDFDIR)
121112
mv -f aux/canopy.pdf $(PDFDIR)
122113

123114
.PHONY: auxnu5 nu5
@@ -130,6 +121,7 @@ auxnu5:
130121

131122
nu5:
132123
$(MAKE) auxnu5
124+
mkdir -p $(PDFDIR)
133125
mv -f aux/nu5.pdf $(PDFDIR)
134126

135127
.PHONY: auxnu6 nu6
@@ -142,6 +134,7 @@ auxnu6:
142134

143135
nu6:
144136
$(MAKE) auxnu6
137+
mkdir -p $(PDFDIR)
145138
mv -f aux/nu6.pdf $(PDFDIR)/protocol.pdf
146139

147140
.PHONY: auxnu6-dark nu6-dark
@@ -154,8 +147,9 @@ auxnu6-dark:
154147

155148
nu6-dark:
156149
$(MAKE) auxnu6-dark
150+
mkdir -p $(PDFDIR)
157151
mv -f aux/nu6-dark.pdf $(PDFDIR)/protocol-dark.pdf
158152

159153
.PHONY: clean
160154
clean:
161-
rm -f aux/* protocol.ver $(PDFDIR)/protocol.pdf $(PDFDIR)/protocol-dark.pdf $(PDFDIR)/nu5.pdf $(PDFDIR)/canopy.pdf $(PDFDIR)/heartwood.pdf $(PDFDIR)/blossom.pdf $(PDFDIR)/sapling.pdf
155+
rm -f aux/* protocol.ver $(PDFDIR)/*

rendered/COPYING.html

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)