Skip to content

Commit

Permalink
Merge pull request patriciogonzalezvivo#378 from sroucheray/feat/buil…
Browse files Browse the repository at this point in the history
…d-book-action

Create a github action to build and release the book
  • Loading branch information
patriciogonzalezvivo authored Apr 8, 2023
2 parents d877b49 + 123ab2e commit 7541e8e
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build Book
on:
push:
tags:
- v*

jobs:
build:
runs-on: ubuntu-20.04
env:
DISPLAY: ':99.0'
steps:
- uses: actions/checkout@v2
- name: Set tag release as environment variable
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Step 1 - Install required APT packages
run: |
sudo add-apt-repository ppa:patriciogv/glslviewer-ppa
sudo apt-get update
# Setup the X11
sudo apt-get install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
sudo apt-get install glslviewer texlive-xetex pandoc python2.7
- name: Step 2 - Build books
run: make all
- name: Step 3 - Append version to book files
run: |
mkdir release
mv book.pdf release/book-$RELEASE_VERSION.pdf
mv book.epub release/book-$RELEASE_VERSION.epub
mv book.tex release/book-$RELEASE_VERSION.tex
- name: Step 4 - Release books
uses: fnkr/github-action-ghr@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GHR_PATH: release/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GHR_REPLACE: true

0 comments on commit 7541e8e

Please sign in to comment.