Skip to content

Commit 02f30e4

Browse files
stsquadwmamills
authored andcommitted
local: add local build help and github automation (!UPSTREAM)
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.4 working draft as a base (!UPSTREAM) * 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>
1 parent a0b809a commit 02f30e4

9 files changed

Lines changed: 123 additions & 17 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# Thanks for proposing a change to the Virtual I/O Device (VIRTIO) specification!
2-
The VIRTIO TC is not yet accepting pull requests at this time as they are not
3-
integrated with our voting system.
1+
# Thanks for proposing a change to the virtio-msg specification
42

5-
Instead, please
6-
- [] 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).
7-
- [] Open an [issue](https://github.com/oasis-tcs/virtio-spec/issues),
8-
including the link to the proposal in the [mailing list archives](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio#feedback).
3+
This is not the same as proposing a change to the VirtIO spec. This
4+
repository is intended for preparing the virtio-msg transport
5+
specification before it's submission to the VIRTIO TC.
96

10-
The TC will vote and apply the change.
7+
If your intention was to suggestion to change to the upstream please
8+
propose the change as a patch to the [mailing list](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio#feedback).

.github/workflows/deploy.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy current state
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: xu-cheng/texlive-action@v2
11+
with:
12+
scheme: full
13+
run: |
14+
apk add file font-liberation make zip
15+
make local-all
16+
echo ${{ github.sha }} > Release.txt
17+
18+
- name: Create Draft Release
19+
id: create_release
20+
uses: actions/create-release@v1
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
with:
24+
tag_name: ${{github.ref_name}}-${{ github.repository_owner }}-draft-v${{ github.run_number }}
25+
release_name: Draft ${{ github.run_number }}
26+
draft: false
27+
prerelease: false
28+
29+
- name: Upload Release Asset
30+
uses: actions/upload-release-asset@v1
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
with:
34+
upload_url: ${{ steps.create_release.outputs.upload_url }}
35+
asset_path: virtio-v1.4-wd01.pdf
36+
asset_name: ${{github.ref_name}}-${{ github.repository_owner }}-draft-v${{ github.run_number }}.pdf
37+
asset_content_type: application/pdf

.github/workflows/test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: CI
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: xu-cheng/texlive-action@v2
11+
with:
12+
scheme: full
13+
run: |
14+
apk add file make zip
15+
make local-html

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- Mode: makefile -*-
2+
#
3+
# Basic Makefile to aid automation of document building
4+
#
5+
6+
.PHONY: all local
7+
all:
8+
./makeall.sh
9+
10+
local-all:
11+
./makeall.sh local
12+
13+
.PHONY: html local-html
14+
15+
html:
16+
./makehtml.sh
17+
18+
local-html:
19+
./makehtml.sh local
20+
21+
.PHONY: clean
22+
clean:
23+
git clean -fd
24+
25+
.PHONY: help
26+
help:
27+
@echo "Build the VIRTIO specification documents."
28+
@echo ""
29+
@echo "Possible operations are:"
30+
@echo
31+
@echo " $(MAKE) Build everything"
32+
@echo " $(MAKE) html Build local html"
33+
@echo " $(MAKE) clean Remove all intermediate files"

REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
virtio-v1.3-csd01
1+
virtio-v1.4-wd01

make-setup-generated.sh

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
11
#! /bin/sh
2+
#
3+
# Generate version and metadata preamble for the document
4+
#
25

36
DATESTR=${DATESTR:-`cat REVISION-DATE 2>/dev/null`}
4-
if [ x"$DATESTR" = x ]; then
5-
ISODATE=`git show --format=format:'%cd' --date=iso | head -n 1`
6-
DATESTR=`date -d "$DATE" +'%d %B %Y'`
7+
8+
# If a second argument is passed we extract what we can from git
9+
# metadata (closest lightweight tag) and local tree status. This
10+
# allows locally generated copies to be tagged appropriately.
11+
#
12+
# The formal build process skips this.
13+
if ! test -z "$2"; then
14+
TAG=$(git describe --dirty --tags)
15+
# base date on now
16+
DATESTR=$(date +'%d %B %Y')
17+
COMMIT=$(git rev-parse --short HEAD)
18+
19+
# Finally check if we have un-committed changes in the tree
20+
if ! git diff-index --quiet HEAD -- ; then
21+
COMMIT="$COMMIT with local changes"
22+
fi
723
fi
824

925
case "$1" in
1026
*-wd*)
1127
STAGE=wd
1228
STAGENAME="Working Draft"
13-
WORKINGDRAFT=`basename "$1" | sed 's/.*-wd//'`
1429
;;
1530
*-os*)
1631
STAGE=os
@@ -41,6 +56,14 @@ esac
4156

4257
VERSION=`echo "$1"| sed -e 's/virtio-v//' -e 's/-.*//'`
4358

59+
#
60+
# Finally if we are building a local draft copy append the commit
61+
# details to the end of the working draft
62+
#
63+
if ! test -z "$COMMIT" ; then
64+
STAGEEXTRATITLE="$STAGEEXTRATITLE (@ git $COMMIT)"
65+
fi
66+
4467
#Prepend OASIS unless already there
4568
case "$STAGENAME" in
4669
OASIS*)

makeall.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
export SPECDOC=${SPECDOC:-`cat REVISION`}
44
export DATESTR=${DATESTR:-`cat REVISION-DATE`}
55
./makezip.sh
6-
./makehtml.sh
7-
./makepdf.sh
6+
./makehtml.sh $1
7+
./makepdf.sh $1
88
zip $SPECDOC.zip $SPECDOC.pdf
99
echo Generated file $SPECDOC.zip
1010
echo To change output file name, set SPECDOC environment variable

makehtml.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
SPECDOC=${SPECDOC:-`cat REVISION`}
4-
./make-setup-generated.sh "$SPECDOC"
4+
./make-setup-generated.sh "$SPECDOC" $1
55

66
cp virtio-html.tex $SPECDOC.tex
77

makepdf.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
SPECDOC=${SPECDOC:-`cat REVISION`}
4-
./make-setup-generated.sh "$SPECDOC"
4+
./make-setup-generated.sh "$SPECDOC" $1
55

66
rm $SPECDOC.aux $SPECDOC.pdf $SPECDOC.out
77
xelatex --jobname $SPECDOC virtio.tex

0 commit comments

Comments
 (0)