Skip to content

Merge pull request #1313 from p4lang/release_v1.2.5 #128

Merge pull request #1313 from p4lang/release_v1.2.5

Merge pull request #1313 from p4lang/release_v1.2.5 #128

Workflow file for this run

name: Build and push specification files
on:
push:
branches: [ main ]
jobs:
build:
if: ${{ github.repository == 'p4lang/p4-spec' }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
# Fetch all history for all branches
fetch-depth: 0
- name: Install madoko
run: sudo npm install -g madoko
- name: Install LaTeX packages and fonts
run: |
sudo apt-get update
sudo apt-get install -qq texlive-latex-recommended texlive-latex-extra texlive-fonts-extra ttf-xfree86-nonfree texlive-science texlive-xetex dvipng
- name: Configure git
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
- name: Rebase gh-pages branch
run: |
git checkout gh-pages
git rebase --quiet main
- name: Install local fonts
# This step should run after checkout to gh-pages
run: |
sudo mkdir -p /usr/share/fonts/truetype/UtopiaStd /usr/share/fonts/truetype/LuxiMono
sudo cp fonts/UtopiaStd-Regular.otf /usr/share/fonts/truetype/UtopiaStd/
sudo cp fonts/luximr.ttf /usr/share/fonts/truetype/LuxiMono/
sudo cp fonts/fix_helvetica.conf /etc/fonts/local.conf
fc-cache -fv
- name: Build p4-16/spec
run: |
make -C p4-16/spec
cp p4-16/spec/build/P4-16-spec.html docs/P4-16-working-spec.html
cp p4-16/spec/build/P4-16-spec.pdf docs/P4-16-working-spec.pdf
- name: Build p4-16/psa
run: |
make -C p4-16/psa
cp p4-16/psa/build/PSA.html docs/PSA.html
cp p4-16/psa/build/PSA.pdf docs/PSA.pdf
cp p4-16/psa/build/P4_Arch_Charter.html docs/P4_Arch_Charter.html
- name: Build api/charter
run: |
make -C api/charter
cp api/charter/build/P4_API_WG_charter.html docs/P4_API_WG_charter.html
- name: Declare sha_short variable
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short $GITHUB_SHA)"
- name: Commit changes
run: |
git commit -m "docs for ${{ steps.vars.outputs.sha_short }}" docs/P4-16-working-spec.{html,pdf} docs/PSA.{html,pdf} docs/P4_API_WG_charter.html docs/P4_Arch_Charter.html
- name: Push commit to gh-pages branch
run: git push -f origin gh-pages