Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
79 changes: 79 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DEFAULT_GOAL := check

SHELL := /bin/bash

CDDL_DIR := ./cddl/

check:
$(MAKE) -C $(CDDL_DIR)
Empty file added spec.tcg
Empty file.