Skip to content
Merged
Show file tree
Hide file tree
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
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: LaTeX CI

on:
pull_request:
branches: [ master ]
push:
branches: [ master ]

jobs:
changes:
runs-on: ubuntu-latest

outputs:
matrix: ${{ steps.matrix.outputs.matrix }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- id: matrix
shell: bash
run: |
DOCS=("bylaws" "policies" "board-procedures")

if [ "${{ github.event_name }}" = "pull_request" ]; then
BASE_SHA="${{ github.event.pull_request.base.sha }}"
else
BASE_SHA="${{ github.event.before }}"
fi

CHANGED=$(git diff --name-only "$BASE_SHA" "${{ github.sha }}")

SHARED_CHANGED=false
for file in logo.png mathsoc.cls mathsoc.sty title.tex; do
if echo "$CHANGED" | grep -q "^${file}$"; then
SHARED_CHANGED=true
break
fi
done

if [ "$SHARED_CHANGED" = true ]; then
MATRIX='{"directory":["bylaws","policies","board-procedures"]}'
else
DIRS=()

for dir in "${DOCS[@]}"; do
if echo "$CHANGED" | grep -q "^${dir}/"; then
DIRS+=("\"${dir}\"")
fi
done

MATRIX="{\"directory\":[$(IFS=,; echo "${DIRS[*]}")]}"
fi

echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT"

build:
needs: changes

if: ${{ fromJson(needs.changes.outputs.matrix).directory[0] != null }}

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.changes.outputs.matrix) }}

container:
image: ghcr.io/xu-cheng/texlive-full:latest

steps:
- uses: actions/checkout@v4

- name: Build ${{ matrix.directory }}
run: |
make -C "${{ matrix.directory }}" public

- name: Upload PDF
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.directory }}
path: ${{ matrix.directory }}/dist/*.pdf
23 changes: 0 additions & 23 deletions .github/workflows/makefile.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish PDFs

on:
push:
branches:
- master

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

container:
image: ghcr.io/xu-cheng/texlive-full:latest

steps:
- uses: actions/checkout@v4

- name: Build bylaws
run: make -C bylaws public

- name: Build policies
run: make -C policies public

- name: Build board-procedures
run: make -C board-procedures public

- name: Prepare Pages content
run: |
mkdir site

cp bylaws/dist/*.pdf site/
cp policies/dist/*.pdf site/
cp board-procedures/dist/*.pdf site/

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: site

deploy:
needs: build

runs-on: ubuntu-latest

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

permissions:
pages: write
id-token: write

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 2 additions & 2 deletions board-procedures/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ all: public
touch .refresh

$(DIST_FOLDER):
mkdir ./dist
mkdir -p ./dist

$(COMPILATION_FOLDER):
mkdir ./bin
mkdir -p ./bin

public: $(SOURCES_P)
$(LATEXMK) $(LATEXMKOPT) \
Expand Down
4 changes: 2 additions & 2 deletions bylaws/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ all: public annotated
touch .refresh

$(DIST_FOLDER):
mkdir ./dist
mkdir -p ./dist

$(COMPILATION_FOLDER):
mkdir ./bin
mkdir -p ./bin

watch: .refresh $(SOURCES_C)
$(LATEXMK) $(LATEXMKOPT) $(CONTINUOUS) \
Expand Down
4 changes: 2 additions & 2 deletions policies/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ all: public
touch .refresh

$(DIST_FOLDER):
mkdir ./dist
mkdir -p ./dist

$(COMPILATION_FOLDER):
mkdir ./bin
mkdir -p ./bin

watch: .refresh $(SOURCES_C)
$(LATEXMK) $(LATEXMKOPT) $(CONTINUOUS) \
Expand Down