Update CHANGES.rst #2120
Workflow file for this run
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: Create cheatsheet | |
on: | |
push: | |
branches: | |
- "**" | |
tags: | |
- "v*.*.*" | |
jobs: | |
cheatsheet: | |
runs-on: ubuntu-latest | |
if: "'refs/heads/master' != github.ref && 'refs/heads/develop' != github.ref && !startsWith(github.ref, 'refs/tags/')" | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
uses: ./.github/actions/install-linux | |
- name: Install xetex | |
run: | | |
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu jammy main restricted multiverse universe" | |
sudo apt-get update -y | |
sudo apt-get install -y -t jammy texlive-xetex | |
- name: Build cheatsheet | |
run: | | |
sphinx-build -b latex -c docs/cheatsheet/ docs docs/latex/ -W | |
cd docs/latex/ | |
xelatex cheatsheet | |
cat <(md5sum cheatsheet.tex) <(md5sum sdsc_cheatsheet.cls) > ../cheatsheet_hash_new | |
cd ../.. | |
env: | |
CHEATSHEET_TARGET: rp | |
- name: Build cheatsheet json | |
run: | | |
sphinx-build -b json -c docs/cheatsheet/ docs docs/json/ -W | |
cd docs/json/ | |
python -c 'import json; print(json.dumps(json.loads(json.load(open("cheatsheet.fjson", "r"))["body"]), indent=2, sort_keys=True))' > cheatsheet.json | |
cat <(md5sum cheatsheet.json) > ../cheatsheet_json_hash_new | |
cd ../.. | |
- name: Publish cheatsheet if changed | |
id: publish-pdf | |
if: ${{ hashFiles('docs/cheatsheet_hash') != hashFiles('docs/cheatsheet_hash_new') }} | |
run: | | |
cat docs/cheatsheet_hash | |
cat docs/cheatsheet_hash_new | |
cd docs | |
rm cheatsheet_hash | |
mv cheatsheet_hash_new cheatsheet_hash | |
cp latex/cheatsheet.pdf _static/cheatsheet/ | |
git add cheatsheet_hash _static/cheatsheet/cheatsheet.pdf | |
git commit -m "chore: Update cheatsheet pdf" | |
- name: Publish UI cheatsheet if changed | |
id: publish-json | |
if: ${{ hashFiles('docs/cheatsheet_json_hash') != hashFiles('docs/cheatsheet_json_hash_new') }} | |
run: | | |
cat docs/cheatsheet_json_hash | |
cat docs/cheatsheet_json_hash_new | |
cd docs | |
rm cheatsheet_json_hash | |
mv cheatsheet_json_hash_new cheatsheet_json_hash | |
cp json/cheatsheet.json _static/cheatsheet/ | |
git add cheatsheet_json_hash _static/cheatsheet/cheatsheet.json | |
git commit -m "chore: Update cheatsheet json" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
if: (steps.publish-pdf.outcome != 'Skipped' || steps.publish-json.outcome != 'Skipped') && success() | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |