Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/any-branch-uploads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
run: |
make -C docs/tools/
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-asciidoc make
ls docs/v1/P4Runtime-Spec.pdf
ls docs/v1/P4Runtime-Spec.html
ls docs/v1/build
- name: Upload spec to S3 if needed
if: ${{ github.actor != 'dependabot[bot]' }}
uses: jakejarvis/[email protected]
Expand All @@ -27,5 +26,5 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-2'
SOURCE_DIR: 'docs/v1'
SOURCE_DIR: 'docs/v1/build'
DEST_DIR: ci/${{ github.ref_name }} # only runs for push events
8 changes: 3 additions & 5 deletions .github/workflows/main-branch-uploads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ jobs:
run: |
make -C docs/tools/
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-asciidoc make
ls docs/v1/P4Runtime-Spec.pdf
ls docs/v1/P4Runtime-Spec.html
ls docs/v1/build
- name: Upload spec to S3
uses: jakejarvis/[email protected]
with:
Expand All @@ -29,15 +28,14 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-2'
SOURCE_DIR: 'docs/v1'
SOURCE_DIR: 'docs/v1/build'
DEST_DIR: docs/main
- name: Prepare spec for upload to gh-pages
run: |
git checkout gh-pages
mkdir -p spec
rm -rf spec/main
cp docs/v1/P4Runtime-Spec.html spec/main
cp docs/v1/P4Runtime-Spec.pdf spec/main
cp -r docs/v1/build spec/main
- name: Upload spec to gh-pages
uses: EndBug/add-and-commit@v9
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ jobs:
run: |
make -C docs/tools/
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-asciidoc make build_spec_with_images
ls docs/v1/P4Runtime-Spec.pdf
ls docs/v1/P4Runtime-Spec.html
ls docs/v1/build
6 changes: 2 additions & 4 deletions .github/workflows/tag-uploads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
run: |
make -C docs/tools/
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-asciidoc make
ls docs/v1/P4Runtime-Spec.pdf
ls docs/v1/P4Runtime-Spec.html
ls docs/v1/build
- name: Upload spec to S3
uses: jakejarvis/[email protected]
with:
Expand All @@ -38,8 +37,7 @@ jobs:
git checkout gh-pages
mkdir -p spec
rm -rf spec/$TAG
cp docs/v1/P4Runtime-Spec.html spec/$TAG
cp docs/v1/P4Runtime-Spec.pdf spec/$TAG
cp -r docs/v1/build spec/$TAG
- name: Upload spec to gh-pages
uses: EndBug/add-and-commit@v9
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Emacs
*~
docs/v1/build/
.DS_Store
build
dist
Expand Down
15 changes: 10 additions & 5 deletions docs/v1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,27 @@ ROUGE_CSS=style

all: ${SPEC}.pdf ${SPEC}.html

folder:
mkdir -p build

build:

${SPEC}.pdf: ${SPEC}.adoc images
${SPEC}.pdf: ${SPEC}.adoc images folder
time asciidoctor-pdf -v \
-a pdf-fontsdir=resources/fonts \
-r asciidoctor-mathematical \
-r asciidoctor-bibtex \
-r asciidoctor-lists \
-a rouge-style=$(ROUGE_STYLE) $<
-a rouge-style=$(ROUGE_STYLE) \
-D build $<

${SPEC}.html: ${SPEC}.adoc images
${SPEC}.html: ${SPEC}.adoc images folder
time asciidoctor -v \
-r asciidoctor-mathematical \
-r asciidoctor-bibtex \
-r asciidoctor-lists \
-a rouge-css=$(ROUGE_CSS) $<
-a rouge-css=$(ROUGE_CSS) \
-D build $<

images:
soffice --convert-to svg --outdir resources/figs resources/figs/*.odg > /dev/null 2>&1
Expand All @@ -29,4 +34,4 @@ images:
build_spec_with_images: images all

clean:
/bin/rm -f ${SPEC}.pdf ${SPEC}.html
/bin/rm -rf build resources/figs/*.png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we delete the resources/figs/*.png files, may as well also delete the *.svg files in that directory, too, yes?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dscano @jafingerhut Is this resolved? I would like to merge this so incoming PRs can be synced.

Loading