From: Alex Bennée alex.bennee@linaro.org
Local only changes for our githib repo. Changes to: * make building easier for developers * respond to local pull-requests * automate build & publish for pushes and local PRs
Individual changes done by Alex and squashed by Bill.
github: tweak PR template for virtio-msg (!UPSTREAM)
While we are working on the virtio-msg specification in the repository lets not confuse people by using the canned response for the upstream repository.
REVISION: set to 1.5 working draft as a base (!UPSTREAM)
fixup name of pdf file to match new REVISION
* Makefile: add some simple make automations
This is just a helpful shortcut, especially when editing the documents within an IDE which will offer up make targets to build the documents.
make-setup-generated: optionally add GIT metadata
This isn't a full conversion to git based metadata but it allows for local builds to add git commit and tree status to the final built product. The normal formal build process is unaffected and uses manually updated VERSION, REVISION and REVISION-DATE metadata.
github: add basic test build
github: add deploy step
This pushes the PDF as a release artefact.
github: add an update step before installing texlive
Otherwise you run into issues of the upstream has updated packages since the last snapshot.
github: use a different release/publish pipeline
Having a draft means that the final asset won't be visible outside the project which is what we want. This entails tagging a release each time we run the steps.
github: only run the test phase on PRs
The release is done on pushes.
Signed-off-by: Alex Bennée alex.bennee@linaro.org
github: use dedicated latex image
Installing all the latext tools from scratch takes some time and can time out. Lets use an image that already has all the bits. The texlive-full image is based on Alpin and we need to install a few helper tools for build.
Signed-off-by: Alex Bennée alex.bennee@linaro.org
github: add liberation font
We don't need it for the HTML but the full PDF needs fonts to render properly.
Signed-off-by: Alex Bennée alex.bennee@linaro.org
github: give tag and pdf names unique to owner fork and branch
The job number is not unique for different forks and this causes issues with the tags which are global. Use the repo owners github name in the tag and the branch as well. Still include the job number to make unique.
Also change the pdf file name so we know where it came from.
Signed-off-by: Bill Mills bill.mills@linaro.org --- .github/PULL_REQUEST_TEMPLATE.md | 14 +++++------- .github/workflows/deploy.yaml | 38 ++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 15 +++++++++++++ Makefile | 33 +++++++++++++++++++++++++++ REVISION | 2 +- make-setup-generated.sh | 31 ++++++++++++++++++++++---- makeall.sh | 4 ++-- makehtml.sh | 2 +- makepdf.sh | 2 +- 9 files changed, 124 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/deploy.yaml create mode 100644 .github/workflows/test.yml create mode 100644 Makefile
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 69d41fc..ea4ed16 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,10 +1,8 @@ -# Thanks for proposing a change to the Virtual I/O Device (VIRTIO) specification! -The VIRTIO TC is not yet accepting pull requests at this time as they are not -integrated with our voting system. +# Thanks for proposing a change to the virtio-msg specification
-Instead, please -- [] Propose the spec change (preferably as a patch) on the [mailing list](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio#feedback). -- [] Open an [issue](https://github.com/oasis-tcs/virtio-spec/issues), - including the link to the proposal in the [mailing list archives](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio#feedback). +This is not the same as proposing a change to the VirtIO spec. This +repository is intended for preparing the virtio-msg transport +specification before it's submission to the VIRTIO TC.
-The TC will vote and apply the change. +If your intention was to suggestion to change to the upstream please +propose the change as a patch to the [mailing list](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio#feedback). diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..60a2d62 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,38 @@ +name: Deploy current state + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: xu-cheng/texlive-action@v2 + with: + scheme: full + run: | + apk add file font-liberation make zip + make local-all + echo ${{ github.sha }} > Release.txt + ls -l *.pdf + + - name: Create Draft Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{github.ref_name}}-${{ github.repository_owner }}-draft-v${{ github.run_number }} + release_name: Draft ${{ github.run_number }} + draft: false + prerelease: false + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: virtio-v1.5-wd1.pdf + asset_name: ${{github.ref_name}}-${{ github.repository_owner }}-draft-v${{ github.run_number }}.pdf + asset_content_type: application/pdf diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..34f4f44 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,15 @@ +name: CI + +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: xu-cheng/texlive-action@v2 + with: + scheme: full + run: | + apk add file make zip + make local-html diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..989b429 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +# -*- Mode: makefile -*- +# +# Basic Makefile to aid automation of document building +# + +.PHONY: all local +all: + ./makeall.sh + +local-all: + ./makeall.sh local + +.PHONY: html local-html + +html: + ./makehtml.sh + +local-html: + ./makehtml.sh local + +.PHONY: clean +clean: + git clean -fd + +.PHONY: help +help: + @echo "Build the VIRTIO specification documents." + @echo "" + @echo "Possible operations are:" + @echo + @echo " $(MAKE) Build everything" + @echo " $(MAKE) html Build local html" + @echo " $(MAKE) clean Remove all intermediate files" diff --git a/REVISION b/REVISION index 409dda0..c9dc11f 100644 --- a/REVISION +++ b/REVISION @@ -1 +1 @@ -virtio-v1.4-csprd01 +virtio-v1.5-wd1 diff --git a/make-setup-generated.sh b/make-setup-generated.sh index 2c5c7f8..3380437 100755 --- a/make-setup-generated.sh +++ b/make-setup-generated.sh @@ -1,16 +1,31 @@ #! /bin/sh +# +# Generate version and metadata preamble for the document +#
DATESTR=${DATESTR:-`cat REVISION-DATE 2>/dev/null`} -if [ x"$DATESTR" = x ]; then - ISODATE=`git show --format=format:'%cd' --date=iso | head -n 1` - DATESTR=`date -d "$DATE" +'%d %B %Y'` + +# If a second argument is passed we extract what we can from git +# metadata (closest lightweight tag) and local tree status. This +# allows locally generated copies to be tagged appropriately. +# +# The formal build process skips this. +if ! test -z "$2"; then + TAG=$(git describe --dirty --tags) + # base date on now + DATESTR=$(date +'%d %B %Y') + COMMIT=$(git rev-parse --short HEAD) + + # Finally check if we have un-committed changes in the tree + if ! git diff-index --quiet HEAD -- ; then + COMMIT="$COMMIT with local changes" + fi fi
case "$1" in *-wd*) STAGE=wd STAGENAME="Working Draft" - WORKINGDRAFT=`basename "$1" | sed 's/.*-wd//'` ;; *-os*) STAGE=os @@ -41,6 +56,14 @@ esac
VERSION=`echo "$1"| sed -e 's/virtio-v//' -e 's/-.*//'`
+# +# Finally if we are building a local draft copy append the commit +# details to the end of the working draft +# +if ! test -z "$COMMIT" ; then + STAGEEXTRATITLE="$STAGEEXTRATITLE (@ git $COMMIT)" +fi + #Prepend OASIS unless already there case "$STAGENAME" in OASIS*) diff --git a/makeall.sh b/makeall.sh index 37e6c34..5f5d5dc 100755 --- a/makeall.sh +++ b/makeall.sh @@ -3,8 +3,8 @@ export SPECDOC=${SPECDOC:-`cat REVISION`} export DATESTR=${DATESTR:-`cat REVISION-DATE`} ./makezip.sh -./makehtml.sh -./makepdf.sh +./makehtml.sh $1 +./makepdf.sh $1 zip $SPECDOC.zip $SPECDOC.pdf echo Generated file $SPECDOC.zip echo To change output file name, set SPECDOC environment variable diff --git a/makehtml.sh b/makehtml.sh index 45b7080..cf1a8d7 100755 --- a/makehtml.sh +++ b/makehtml.sh @@ -1,7 +1,7 @@ #!/bin/sh
SPECDOC=${SPECDOC:-`cat REVISION`} -./make-setup-generated.sh "$SPECDOC" +./make-setup-generated.sh "$SPECDOC" $1
cp virtio-html.tex $SPECDOC.tex
diff --git a/makepdf.sh b/makepdf.sh index 9cae903..bdfb8e5 100755 --- a/makepdf.sh +++ b/makepdf.sh @@ -1,7 +1,7 @@ #!/bin/sh
SPECDOC=${SPECDOC:-`cat REVISION`} -./make-setup-generated.sh "$SPECDOC" +./make-setup-generated.sh "$SPECDOC" $1
rm $SPECDOC.aux $SPECDOC.pdf $SPECDOC.out xelatex --jobname $SPECDOC virtio.tex