Skip to content

Commit fe57d23

Browse files
authored
Merge pull request #4 from accemic/albert/publish-spec-pdf
Publish spec PDF via GitHub Release; stop committing the PDF
2 parents 30d12c8 + 4908610 commit fe57d23

4 files changed

Lines changed: 37 additions & 22 deletions

File tree

.github/workflows/pdf.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@ name: spec-pdf
22

33
on:
44
push:
5-
paths:
6-
- 'spec/**'
7-
- '.github/workflows/pdf.yml'
5+
branches: [main]
6+
tags: ['v*']
87
pull_request:
98
paths:
109
- 'spec/**'
1110
- '.github/workflows/pdf.yml'
1211
workflow_dispatch:
1312

13+
# Allow the release step to create releases and upload assets.
14+
permissions:
15+
contents: write
16+
1417
jobs:
1518
build-pdf:
1619
runs-on: ubuntu-latest
@@ -31,10 +34,23 @@ jobs:
3134
-a attribute-missing=warn \
3235
--failure-level=ERROR \
3336
spec/tn-ctxp-format.adoc \
34-
-o spec/tn-ctxp-format.pdf
37+
-o tn-ctxp-format.pdf
3538
36-
- uses: actions/upload-artifact@v4
39+
- name: Upload PDF as build artifact
40+
uses: actions/upload-artifact@v4
3741
with:
3842
name: tn-ctxp-format-pdf
39-
path: spec/tn-ctxp-format.pdf
43+
path: tn-ctxp-format.pdf
4044
if-no-files-found: error
45+
46+
# On a version tag (e.g. v1.1.0), publish the PDF as a release asset.
47+
# The stable "latest" link is:
48+
# https://github.com/<owner>/<repo>/releases/latest/download/tn-ctxp-format.pdf
49+
- name: Publish PDF to GitHub Release
50+
if: startsWith(github.ref, 'refs/tags/v')
51+
env:
52+
GH_TOKEN: ${{ github.token }}
53+
run: |
54+
gh release create "$GITHUB_REF_NAME" tn-ctxp-format.pdf \
55+
--title "$GITHUB_REF_NAME" --generate-notes \
56+
|| gh release upload "$GITHUB_REF_NAME" tn-ctxp-format.pdf --clobber

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
*.pyc
22
__pycache__/
33
.venv/
4+
5+
# Generated locally; published via the spec-pdf release workflow
6+
tn-ctxp-format.pdf

README.adoc

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ This repository aims to be a *publication-quality* reference for the CTXP format
1111
* Canonical, curated examples
1212
* A small linter to keep examples consistent
1313
14-
The authoritative specification is included in link:spec/tn-ctxp-format.pdf[`spec/tn-ctxp-format.pdf`].
14+
*Specification (PDF):* download the latest release —
15+
https://github.com/accemic/C-Trace-eXPort-format/releases/latest/download/tn-ctxp-format.pdf[*tn-ctxp-format.pdf*].
16+
The AsciiDoc source lives in link:spec/[`spec/`].
1517

1618
== Quick start
1719

@@ -46,28 +48,22 @@ for the full set of curated example traces and explanations.
4648

4749
== Documentation
4850

49-
The authoritative format specification is in link:spec/tn-ctxp-format.pdf[`spec/tn-ctxp-format.pdf`].
51+
The authoritative format specification is the PDF published as a *GitHub Release* asset:
52+
https://github.com/accemic/C-Trace-eXPort-format/releases/latest/download/tn-ctxp-format.pdf[`tn-ctxp-format.pdf` (latest release)].
5053

5154
Its AsciiDoc source lives in link:spec/[`spec/`] (link:spec/tn-ctxp-format.adoc[`tn-ctxp-format.adoc`]
5255
+ link:spec/ctxp-format.adoc[`ctxp-format.adoc`] + diagrams under link:spec/images/[`spec/images/`]).
53-
The PDF is regenerated by the `spec-pdf` GitHub Action on every change under `spec/`; to build it
54-
locally:
56+
The `spec-pdf` GitHub Action builds and validates the PDF on every change under `spec/`, and
57+
publishes it as a release asset when a `v*` tag is pushed. To build it locally:
5558

5659
[source,sh]
5760
----
5861
gem install asciidoctor-pdf rouge
59-
asciidoctor-pdf spec/tn-ctxp-format.adoc -o spec/tn-ctxp-format.pdf
62+
asciidoctor-pdf spec/tn-ctxp-format.adoc -o tn-ctxp-format.pdf
6063
----
6164

62-
Diagrams: the editable sources are the `*.drawio.svg` files (drawn with https://draw.io[draw.io]).
63-
The PDF embeds the `*.drawio.png` next to them, because asciidoctor-pdf does not render the
64-
draw.io SVG format cleanly. Regenerate the PNGs after editing a diagram, e.g.:
65-
66-
[source,sh]
67-
----
68-
inkscape spec/images/<name>.drawio.svg --export-type=png \
69-
--export-filename=spec/images/<name>.drawio.png --export-dpi=192
70-
----
65+
Diagrams are the `*.drawio.png` files under link:spec/images/[`spec/images/`], exported from
66+
https://draw.io[draw.io] (asciidoctor-pdf does not render the draw.io SVG format cleanly).
7167

7268
== Tooling (Accemic)
7369

@@ -91,7 +87,7 @@ If you want to evaluate or integrate CTXP tooling, please contact us:
9187

9288
== License / attribution / acknowledgement
9389

94-
The included technical note (`spec/tn-ctxp-format.pdf`) states it is licensed under
95-
Creative Commons Attribution 4.0 International (CC BY 4.0). See the PDF for details.
90+
The CTXP technical note states it is licensed under
91+
Creative Commons Attribution 4.0 International (CC BY 4.0). See the spec for details.
9692

9793
The CTXP format was developed as part of the TRISTAN project, a European Union research initiative involving 46 partners to advance the RISC-V ecosystem. See https://tristan-project.eu/ for more information.

spec/tn-ctxp-format.pdf

-686 KB
Binary file not shown.

0 commit comments

Comments
 (0)