Skip to content

Commit

Permalink
Prepare for the first release (#37)
Browse files Browse the repository at this point in the history
* Reformat template and remove mermaid

* Update conversion and build to remove env and mermaid

* Update build file

* Add missing drafts

* Modified build script name

* Move drafts and include book-creation script

* Include RFC-0033 first draft

* Update readme

* Include releases to the build process

* remove obsolete github action configuration files

* Add comments to book build scripts

* Simplify RFC-0000

* Correctly format RFC-0001

* Updated RFC Tree

* Remove file links from RFC tree

* Change status from published to release to conform to RFC-0003

* Simplify RFC workflow in RFC-0003

* Unify uses of "markdown"

* Update emphasized formatting in RFC-0003

* Remove Openreview.net from RFC-0004

* Remove obsolete footnotes

* Update release scripts

* Remove obsolete footnote

* fix build script

* Use release version for book conversion

* Commit missing changes

* Change dockerfiles base

* Modify python in dockerfiles

* Fix title extraction for book build script

* Add "Release" to release "date"

* Add timestamp to pdf book

* Fix RFC-0001

* Replace draft RFC-0033 with template text

* Fix RFC book conversion script to not damage tables

* Change subtitle and authors of the RFC book

* Add book preface

* Preface changes
  • Loading branch information
yngwi authored Nov 18, 2021
1 parent 7b1bf68 commit e3b4be7
Show file tree
Hide file tree
Showing 49 changed files with 3,344 additions and 2,141 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/on_candidate_push.yml

This file was deleted.

47 changes: 27 additions & 20 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,30 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: rlespinasse/[email protected]

- name: Create version number
run: echo ::set-env name=VERSION::draft-${{ env.GITHUB_SHA_SHORT }}

- name: Build the Docker image that creates the RFC-PDFs
run: docker build $GITHUB_WORKSPACE/build -t time-machine-project/publish_pdfs

- name: Create the output directories
run: mkdir -p drafts

- name: Create the draft PDFs
run: docker run -e VERSION=${{ env.VERSION }} -v $GITHUB_WORKSPACE/files/drafts:/opt/input -v $GITHUB_WORKSPACE/drafts:/opt/output time-machine-project/publish_pdfs

- uses: actions/upload-artifact@v2
with:
name: rfc_draft_pdf_files
path: drafts
- uses: actions/checkout@v2

- uses: rlespinasse/[email protected]

- name: Create version number
run: echo "VERSION=commit-${{ env.GITHUB_SHA_SHORT }}" >> $GITHUB_ENV

- name: Build the Docker image that creates the RFC-PDFs
run: docker build $GITHUB_WORKSPACE/build -f $GITHUB_WORKSPACE/build/Dockerfile.single -t time-machine-project/publish_pdfs

- name: Create the drafts output directories
run: mkdir -p out/drafts

- name: Create the releases output directories
run: mkdir -p out/releases

- name: Create the draft PDFs
run:
docker run -e VERSION=${{ env.VERSION }} -v $GITHUB_WORKSPACE/files/drafts:/opt/input -v $GITHUB_WORKSPACE/out/drafts:/opt/output time-machine-project/publish_pdfs

- name: Create the release PDFs
run: docker run -e VERSION=${{ env.VERSION }} -v $GITHUB_WORKSPACE/files/releases:/opt/input -v $GITHUB_WORKSPACE/out/releases:/opt/output time-machine-project/publish_pdfs

- uses: actions/upload-artifact@v2
with:
name: rfc_pdf_files
path: out
31 changes: 31 additions & 0 deletions .github/workflows/on_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Compile and attach artifact to release on release publication

on:
release:
types: [released]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Create version number
run: echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV

- name: Build the Docker image that creates the PDF
run: docker build $GITHUB_WORKSPACE/build -f $GITHUB_WORKSPACE/build/Dockerfile.book -t time-machine-project/publish_book

- name: Create the output directory
run: mkdir -p out

- name: Create the PDF
run: docker run -e VERSION=${{ env.VERSION }} -v $GITHUB_WORKSPACE/files:/opt/input -v $GITHUB_WORKSPACE/out:/opt/output time-machine-project/publish_book

- name: Upload the artifacts
uses: alexellis/[email protected]
with:
asset_paths: '["./out/*.pdf"]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51 changes: 0 additions & 51 deletions .github/workflows/on_release_push.yml

This file was deleted.

39 changes: 15 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,22 @@

# Requests for Comments

This repository is the main location for work on and release of finalised Time Machine _Request for Comments_.
This repository is the main location for work on and release of finalised Time
Machine _Request for Comments_.

## Drafts in preparation
## RFCs in preparation

| ID | Title | Draft pull request |
| -------- | ---------------------------------- | ------------------------------------------------------------------------------------------------ |
| RFC-0004 | RFC on the RFC Editorial Committee | [New version of RFC-0004](https://github.com/time-machine-project/requests-for-comments/pull/31) |
| RFC-0005 | RFC on LTM | [Current draft of RFC5](https://github.com/time-machine-project/requests-for-comments/pull/32) |
| ID | Title | Draft file | Draft pull request |
| -------- | ------------------------------------------- | ------------------------------------------------ | ------------------ |
| RFC-0033 | RFC on Map and Cadaster Processing pipeline | [RFC-0033.md](files/drafts/RFC-0000/RFC-0033.md) | |

## Current open drafts

| ID | Contribution deadline | Main file |
| -------- | --------------------- | ------------------------------------------------ |
| RFC-0000 | 2020-11-08 | [RFC-0000.md](files/drafts/RFC-0000/RFC-0000.md) |
| RFC-0001 | 2020-11-08 | [RFC-0001.md](files/drafts/RFC-0001/RFC-0001.md) |
| RFC-0002 | 2020-11-08 | [RFC-0002.md](files/drafts/RFC-0002/RFC-0002.md) |
| RFC-0003 | 2020-11-08 | [RFC-0003.md](files/drafts/RFC-0003/RFC-0003.md) |

## Current open candidates

| ID | Review deadline | Release | Peer Review URL |
| --- | --------------- | ------- | --------------- |

## Published releases

| ID | File | Release | Release date |
| --- | ---- | ------- | ------------ |
## Published RFCs

| ID | File |
| -------- | -------------------------------------------------- |
| RFC-0000 | [RFC-0000.md](files/releases/RFC-0000/RFC-0000.md) |
| RFC-0001 | [RFC-0001.md](files/releases/RFC-0001/RFC-0001.md) |
| RFC-0002 | [RFC-0002.md](files/releases/RFC-0002/RFC-0002.md) |
| RFC-0003 | [RFC-0003.md](files/releases/RFC-0003/RFC-0003.md) |
| RFC-0004 | [RFC-0004.md](files/releases/RFC-0004/RFC-0004.md) |
| RFC-0005 | [RFC-0005.md](files/releases/RFC-0005/RFC-0005.md) |
37 changes: 0 additions & 37 deletions build/Dockerfile

This file was deleted.

22 changes: 22 additions & 0 deletions build/Dockerfile.book
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM pandoc/latex:2.16

RUN apk update && apk upgrade && apk add --no-cache \
bash \
dos2unix \
git \
python3 \
py3-pip \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont

COPY ./convert_book.sh /opt/script/

RUN dos2unix /opt/script/convert_book.sh

RUN chmod +x /opt/script/convert_book.sh

ENTRYPOINT ["/opt/script/convert_book.sh"]
22 changes: 22 additions & 0 deletions build/Dockerfile.single
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM pandoc/latex:2.16

RUN apk update && apk upgrade && apk add --no-cache \
bash \
dos2unix \
git \
python3 \
py3-pip \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont

COPY ./convert_single.sh /opt/script/

RUN dos2unix /opt/script/convert_single.sh

RUN chmod +x /opt/script/convert_single.sh

ENTRYPOINT ["/opt/script/convert_single.sh"]
78 changes: 78 additions & 0 deletions build/convert_book.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/bash

# Initialize variables
inpath=$1
outpath=$2
version=$3
if [ -z "$inpath" ]; then
inpath=/opt/input
fi
if [ -z "$outpath" ]; then
outpath=/opt/output
fi
if [ -z "$version" ]; then
version=${VERSION:=custom-build}
fi
pdfpath="$outpath"/RFC-Book_"$version".pdf
tmppath="$outpath"/tmp
mkdir -p "$tmppath"

# Copy all markdown files into a single folder so relative
# links to files still work in the final markdown
cd "$inpath" || exit
shopt -s globstar
for i in **/*.md; do
cp -r "$(dirname "$i")"/* "$tmppath"
done

cd "$tmppath" || exit

# Create basic markdown content with yaml header
read -r -d '' text <<EOM
---
title: Time Machine Requests for Comments
subtitle: Rules, Recommendations and Core Architectural Choices for Time Machine
author:
- Time Machine Organisation and the RFC writers
documentclass: scrreprt
classoption:
- oneside
output: pdf_document
---
EOM

text="$text"$'\n'$(cat preface.md)$'\n'

# Transform individual markdown files sorted by their name, excluding the template
for md in $(find . -type f -name "*.md" -not -name "RFC-template.md" -not -name "preface.md" | sort | xargs -n 1 basename); do
# Extract metadata
suffix=
if [[ $(find $inpath -type f -name "$(basename "$md")") == *"draft"* ]]; then
suffix=" [Draft]"
fi
title=$(grep '^title: ".*"' "$md" | sed -e 's/^title: "\(.*\)"/\1/')
number=$(basename "$md" .md)
authors=$(sed -n '/^author:/,/^\w/{/^author:/!{/^\w/!p}}' "$md" | sed "s/^ - //g" | paste -s -d"," - | sed 's/,/, /g')
# Transform existing headings to be one level lower
sed -i 's/^#####/######/g' "$md"
sed -i 's/^####/#####/g' "$md"
sed -i 's/^###/####/g' "$md"
sed -i 's/^##/###/g' "$md"
sed -i 's/^#/##/g' "$md"
# Remove yaml block
sed -i '/^---/,/^\---/{/^---/!{/^\---/!d}}' "$md"
sed -i '/^---/d' "$md"
# Insert rfc title heading and authors
sed -i "1s/^/# $number: $title$suffix\n\n$authors\n\n/" "$md"
# append content to joined markdown content
text=$'\n'${text}$'\n'"\newpage"$(cat "$md")$'\n\n'
done

# Build pdf
pandoc -s -M date="Release $version - $(date "+%B %e, %Y")" --toc -f markdown -o "$pdfpath" <(echo "$text")

# Remove temporary files
cd ..
rm -Rf tmp
Loading

0 comments on commit e3b4be7

Please sign in to comment.