Skip to content

fix: separate superscript citation/affiliation callouts from adjacent… #395

fix: separate superscript citation/affiliation callouts from adjacent…

fix: separate superscript citation/affiliation callouts from adjacent… #395

Workflow file for this run

name: CI
on:
push:
branches: ['**']
tags: ['v*']
jobs:
build:
strategy:
matrix:
os: [ self-hosted, macos-latest, ubuntu-24.04-arm, macos-15-intel ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Set OS and ARCH variables
run: |
echo "OS=${{ runner.os == 'Linux' && 'linux' || 'mac' }}" >> $GITHUB_ENV
echo "ARCH=${{ runner.arch == 'X64' && '64' || 'arm64' }}" >> $GITHUB_ENV
shell: bash
- name: Set up dependencies for Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt-get install -qq cmake build-essential clang icu-devtools libfontconfig-dev
- name: Set up dependencies for macOS
if: runner.os == 'macOS'
run: |
brew update
brew upgrade --formula cmake
brew install automake autoconf fontconfig
brew install icu4c ucon64
- name: Display versions macOs
if: runner.os == 'macOS'
run: |
gcc -v
g++ -v
cmake --version
eval $(brew --cellar)/ucon64/*/bin/ucon64 -v
- name: Display versions Linux
if: runner.os == 'Linux'
run: |
gcc -v
g++ -v
cmake --version
uconv -v
- name: Set env variables for macOS x64
if: runner.os == 'macOS' && runner.arch == 'X64'
run: |
echo "C_INCLUDE_PATH=/usr/local/include" >> $GITHUB_ENV
echo "CPLUS_INCLUDE_PATH=/usr/local/include" >> $GITHUB_ENV
# echo "OS_GROBID='mac'" >> $GITHUB_ENV
# echo "ARCH_GROBID='64'" >> $GITHUB_ENV
shell: bash
- name: Set env variables for macOS ARM64
if: runner.os == 'macOS' && runner.arch == 'ARM64'
run: |
echo "C_INCLUDE_PATH=/opt/homebrew/include" >> $GITHUB_ENV
echo "CPLUS_INCLUDE_PATH=/opt/homebrew/include" >> $GITHUB_ENV
# echo "OS_GROBID='mac'" >> $GITHUB_ENV
# echo "ARCH_GROBID='arm64'" >> $GITHUB_ENV
shell: bash
- name: Build for macOS
if: runner.os == 'macOS'
run: |
cmake ./
make
- name: Build on Linux
if: runner.os == 'Linux'
run: |
cmake ./
make
- name: Determine version label
# Same logic as in the assemble-artifact job. We compute it here
# too because each build job needs the label to name its tar.gz
# file. The computation is a pure function of github.ref_name and
# github.sha, so all jobs that run it will get the same answer for
# a given push. (Could be hoisted into a setup job and passed via
# job outputs, but the duplication is small and self-contained.)
id: label
env:
REF_NAME: ${{ github.ref_name }}
IS_TAG: ${{ startsWith(github.ref, 'refs/tags/v') }}
SHA: ${{ github.sha }}
shell: bash
run: |
set -euo pipefail
if [ "$IS_TAG" = "true" ]; then
value="${REF_NAME#v}"
else
value=$(echo "$SHA" | cut -c1-7)
fi
echo "value=${value}" >> "$GITHUB_OUTPUT"
- name: Create per-platform tar.gz (shallow — binary at root)
env:
LABEL: ${{ steps.label.outputs.value }}
shell: bash
run: |
set -euo pipefail
tar -czf "pdfalto-${LABEL}-${OS}-${ARCH}.tar.gz" pdfalto
ls -lh "pdfalto-${LABEL}-${OS}-${ARCH}.tar.gz"
- name: Save pdfalto executable
# Flat layout: the artifact contains just the `pdfalto` binary at root,
# so a developer downloading pdfalto-bin-mac-arm64.zip from the Actions
# UI gets the binary directly with no nested directories. The os/arch
# information is encoded in the artifact NAME and reconstructed by the
# assemble-artifact job, which uses it to build the combined tree.
uses: actions/upload-artifact@v4
with:
name: pdfalto-bin-${{ env.OS }}-${{ env.ARCH }}
path: pdfalto
- name: Save pdfalto tar.gz
# Sibling per-arch artifact alongside the binary upload above. Lets
# a developer download just one platform's tar.gz directly from the
# Actions UI without pulling the full pdfalto-archives-<label> bundle.
uses: actions/upload-artifact@v4
with:
name: pdfalto-gz-${{ env.OS }}-${{ env.ARCH }}
path: pdfalto-${{ steps.label.outputs.value }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
assemble-artifact:
needs: [ build ]
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download per-platform artifacts (flat binaries)
uses: actions/download-artifact@v4
with:
pattern: pdfalto-bin-*
path: incoming
# Each artifact lands at incoming/pdfalto-bin-<os>-<arch>/pdfalto.
# We reconstruct the os/arch tree in the next step using the
# artifact NAME (not the contents).
- name: Reconstruct os/arch tree from artifact names
# The artifact name (pdfalto-bin-<os>-<arch>) encodes the platform.
# OS and ARCH are single tokens with no internal dashes (linux/mac,
# 64/arm64), so splitting on the last dash recovers them. If a future
# runner reports a multi-token os like "linux-musl", this parser will
# need updating.
run: |
set -euo pipefail
mkdir -p output
for dir in incoming/pdfalto-bin-*; do
[ -d "$dir" ] || continue
name=$(basename "$dir") # pdfalto-bin-mac-arm64
rest=${name#pdfalto-bin-} # mac-arm64
os=${rest%-*} # mac
arch=${rest##*-} # arm64
mkdir -p "output/pdfalto/${os}/${arch}"
cp "${dir}/pdfalto" "output/pdfalto/${os}/${arch}/pdfalto"
done
rm -rf incoming
shell: bash
- name: Show assembled tree
run: find output -maxdepth 4 -print
- name: Derive version label
# On a tag push (refs/tags/v*), strip the leading 'v' so files are
# named pdfalto-0.7.0-*.tar.gz. On any other push, use the short
# commit SHA so dev builds get pdfalto-a6d49dc-*.tar.gz. One label
# is computed once and reused for both the artifact names and the
# archive filenames, keeping naming consistent.
id: version
env:
REF_NAME: ${{ github.ref_name }}
IS_TAG: ${{ startsWith(github.ref, 'refs/tags/v') }}
SHA: ${{ github.sha }}
run: |
set -euo pipefail
if [ "$IS_TAG" = "true" ]; then
label="${REF_NAME#v}"
else
label=$(echo "$SHA" | cut -c1-7)
fi
echo "label=${label}" >> "$GITHUB_OUTPUT"
- name: Create per-platform tar.gz archives (shallow — binary at root)
env:
LABEL: ${{ steps.version.outputs.label }}
run: |
set -euo pipefail
for plat_dir in output/pdfalto/*/*/; do
os=$(basename "$(dirname "$plat_dir")")
arch=$(basename "$plat_dir")
tar -czf "pdfalto-${LABEL}-${os}-${arch}.tar.gz" -C "$plat_dir" pdfalto
done
ls -l pdfalto-*.tar.gz
- name: Create combined bundle (preserves os/arch tree)
env:
LABEL: ${{ steps.version.outputs.label }}
run: |
set -euo pipefail
tar -czf "pdfalto-${LABEL}-all.tar.gz" -C output pdfalto
- name: Save assembled tree as artifact
uses: actions/upload-artifact@v4
with:
name: pdfalto-bin-all-${{ steps.version.outputs.label }}
path: output
- name: Save tar.gz archives as artifact
# Uploaded on every push, not just tag pushes — gives dev builds the
# same downloadable archive shape as releases. The release job (gated
# on tag push) downloads this artifact and re-publishes its contents
# to the GitHub Release page.
uses: actions/upload-artifact@v4
with:
name: pdfalto-archives-${{ steps.version.outputs.label }}
path: pdfalto-*.tar.gz
release:
needs: [ assemble-artifact ]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-24.04
permissions:
contents: write # required for softprops/action-gh-release to create the Release
steps:
- name: Download tar.gz archives
# The assemble-artifact job already created and uploaded the archives
# under pdfalto-archives-<label>. We just download and re-publish.
uses: actions/download-artifact@v4
with:
pattern: pdfalto-archives-*
path: dist
merge-multiple: true
- name: Show downloaded archives
run: ls -lh dist/
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/pdfalto-*.tar.gz
draft: false
prerelease: false
# body intentionally left empty — to be filled in manually on github.com