First cut at conversion from LaTeX to mdbook for the CHERI C/C++ guide. #156
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
env: | |
doc_name: cheri-c-programming | |
jobs: | |
build: | |
# TODO: Run on Docker image that has latex pre-installed? | |
runs-on: [ubuntu-18.04] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install latex | |
run: sudo apt-get install -y --no-install-recommends make texlive-plain-generic texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-science texlive-fonts-recommended texlive-fonts-extra biber texlive-bibtex-extra latexmk | |
- name: Build document | |
run: make | |
- name: Upload artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: ${{ env.doc_name }}.pdf | |
path: ${{ env.doc_name }}.pdf | |
draft-release: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
needs: build | |
runs-on: [ubuntu-18.04] | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@master | |
with: | |
name: ${{ env.doc_name }}.pdf | |
path: ./ | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y%m%d')" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: draft-${{ steps.date.outputs.date }}-${{ github.sha }} | |
release_name: Draft release ${{ steps.date.outputs.date }} | |
body: Latest snapshot (${{ github.sha }}) | |
prerelease: true | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./${{ env.doc_name }}.pdf | |
asset_name: ${{ env.doc_name }}-snapshot-${{ github.sha }}.pdf | |
asset_content_type: application/pdf | |