Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cheatsheet] Attempt to regenerate cheatsheet automatically #1390

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/regenerate-cheatsheet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Regenerate tactic cheatsheet
on:
push:
branches:
- master
paths:
- 'Manual/Cheatsheet/**'
workflow_dispatch:

jobs:

regenerate:
runs-on: ubuntu-latest
env:
COMMIT_MSG: ${{ github.workspace }}/commit_msg.txt

steps:
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y build-essential pandoc curl

- name: Checkout HOL
uses: actions/checkout@v4
with:
path: hol

- name: Checkout HOL webpages
uses: actions/checkout@v4
with:
repository: hol-theorem-prover/hol-webpages
path: hol-webpages
token: ${{ secrets.CHEATSHEET_REGEN }}

- name: Regenerate cheatsheet
run: |
cd hol/Manual/Cheatsheet
make -f Holmakefile

- name: Copy cheatsheet into HOL webpages
run: |
cp hol/Manual/Cheatsheet/cheatsheet.html hol-webpages/new-look/cheatsheet.html
cp hol/Manual/Cheatsheet/cheatsheet.css hol-webpages/new-look/cheatsheet.css

- name: Compose commit message
env:
HEAD_COMMIT: ${{github.event.head_commit.id}}
AUTHOR: ${{github.event.pusher.username || github.event.pusher.name}}
run: |
echo "[cheatsheet] Regenerate cheatsheet" > $COMMIT_MSG
echo "" >> $COMMIT_MSG
echo "Trigger: head commit HOL-Theorem-Prover/HOL@$HEAD_COMMIT, by $AUTHOR" >> $COMMIT_MSG

- name: Commit changes to HOL webpages
run: |
cd hol-webpages
git config user.name "GitHub Actions"
git config user.email "<>"
git add new-look/cheatsheet.html new-look/cheatsheet.css
git commit --allow-empty --file $COMMIT_MSG
git push

- name: Update HOL webpages
run: |
curl --silent https://hol-theorem-prover.org/update.cgi