From 8b69a69a96733a1cc6e77edb15c0c4751fdda680 Mon Sep 17 00:00:00 2001 From: nedmsmith Date: Fri, 6 Jun 2025 10:40:35 +0200 Subject: [PATCH 1/3] add CI integration Add CI to build online and to do releases --- .github/workflows/actions.yml | 79 ++++++++++++++++++++++++++++++++++ .github/workflows/makefile.yml | 26 +++++++++++ 2 files changed, 105 insertions(+) create mode 100644 .github/workflows/actions.yml create mode 100644 .github/workflows/makefile.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 0000000..204fc5a --- /dev/null +++ b/.github/workflows/actions.yml @@ -0,0 +1,79 @@ +# Render the spec to PDF and Word on pull requests and releases, attaching the +# outputs to the pull request / release, as appropriate. + +name: Render spec + +on: + pull_request: + release: + types: [published] + +jobs: + render: + runs-on: ubuntu-latest + container: + image: ghcr.io/trustedcomputinggroup/pandoc:0.10.2 + name: Render PDF + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Cache LaTeX files + uses: actions/cache@v3 + env: + cache-name: cache-latex-files + with: + path: | + *.aux + *.fdb_latexmk + *.lof + *.lot + *.toc + *.convert.pdf + key: latex-${{ github.run_id }} + restore-keys: latex + + - name: Render + uses: trustedcomputinggroup/markdown@v0.4.2 + with: + input-md: spec.tcg + extra-build-options: "--versioned_filenames" + output-pdf: spec.pdf + output-docx: spec.docx + + - name: Upload PDF to PR + uses: actions/upload-artifact@master + if: ${{ github.event_name == 'pull_request' }} + with: + name: PDF + path: spec.*.pdf + + - name: Upload Word to PR + uses: actions/upload-artifact@master + if: ${{ github.event_name == 'pull_request' }} + with: + name: Word + path: spec.*.docx + + - name: Upload PDF to release + uses: svenstaro/upload-release-action@v2 + if: ${{ github.event_name == 'release' }} + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: spec.*.pdf + tag: ${{ github.ref }} + overwrite: true + file_glob: true + + - name: Upload Word to release + uses: svenstaro/upload-release-action@v2 + if: ${{ github.event_name == 'release' }} + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: spec.*.docx + tag: ${{ github.ref }} + overwrite: true + file_glob: true diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml new file mode 100644 index 0000000..ed0b8ca --- /dev/null +++ b/.github/workflows/makefile.yml @@ -0,0 +1,26 @@ + +name: CI + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: checkout repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: install tools + run: gem install --user-install cbor-diag cddl cddlc + - name: set up PATH + run: echo "$(gem env gempath | cut -d':' -f1)/bin" >> $GITHUB_PATH + - name: assemble and test + run: make check + - name: publish CDDL + if: startsWith(github.ref, 'refs/tags/cddl-') + uses: softprops/action-gh-release@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: | + ./exports/*.cddl From b5c2ad4e663108b9aea45d7439e1910987905ed3 Mon Sep 17 00:00:00 2001 From: nedmsmith Date: Fri, 6 Jun 2025 10:43:05 +0200 Subject: [PATCH 2/3] Create Makefile top level make file --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..69b41c9 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +.DEFAULT_GOAL := check + +SHELL := /bin/bash + +CDDL_DIR := ./cddl/ + +check: + $(MAKE) -C $(CDDL_DIR) \ No newline at end of file From d511a46da4a74074f8bd92fb83091de78c54e4bf Mon Sep 17 00:00:00 2001 From: nedmsmith Date: Fri, 6 Jun 2025 10:46:04 +0200 Subject: [PATCH 3/3] Create spec.tcg add boilerplate markdown file --- spec.tcg | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 spec.tcg diff --git a/spec.tcg b/spec.tcg new file mode 100644 index 0000000..e69de29