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
49 changes: 45 additions & 4 deletions .github/scripts/package_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,54 @@ case "$fam" in
"fonts/heddle/variable/MachineMadeHeddle[wdth,wght].ttf" "$out/"
;;
warp)
export SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-1793059200}"
name="machine-made-warp-${version}"
need fonts/warp/ttf/MachineMadeWarp-Regular.ttf fonts/warp/ttf/MachineMadeWarp-Italic.ttf \
fonts/warp/ttf/MachineMadeWarp-Bold.ttf fonts/warp/ttf/MachineMadeWarp-BoldItalic.ttf \
fonts/warp/ttf/MachineMadeWarpDisplay-Regular.ttf fonts/warp/ttf/MachineMadeWarpDisplay-Italic.ttf \
fonts/warp/otf/MachineMadeWarp-Regular.otf fonts/warp/webfonts/MachineMadeWarp-Regular.woff2 \
'fonts/warp/vf/MachineMadeWarp[wght].ttf' \
'fonts/warp/vf/MachineMadeWarp-Italic[wght].ttf' \
'fonts/warp/vf/MachineMadeWarp[wght].woff2' \
'fonts/warp/vf/MachineMadeWarp-Italic[wght].woff2' \
proofs/warp/ladder.json proofs/warp/release.json \
warp/OFL.txt "warp/RELEASE-NOTES-${notes_version}.md" "$out/readability.json"
for style in MachineMadeWarp-Regular MachineMadeWarp-Italic MachineMadeWarp-Bold \
MachineMadeWarp-BoldItalic MachineMadeWarpDisplay-Regular MachineMadeWarpDisplay-Italic; do
need "fonts/warp/ttf/$style.ttf" "fonts/warp/otf/$style.otf" "fonts/warp/webfonts/$style.woff2"
done
# Final font hashes are separate from the historical inspector measurements.
python3 - <<'CHECK_WARP'
import hashlib
import json
from pathlib import Path

proof = json.loads(Path("proofs/warp/ladder.json").read_text())
release = json.loads(Path("proofs/warp/release.json").read_text())
for slope, suffix in (("Roman", ""), ("Italic", "-Italic")):
name = f"MachineMadeWarp{suffix}[wght].ttf"
path = Path("fonts/warp/vf") / name
expected = release["variable_fonts"][name]
measured = release["styles"][slope]
pinned = proof["styles"][slope]
if (path.stat().st_size != expected["size_bytes"]
or path.stat().st_size != pinned["file_size_bytes"]
or hashlib.sha256(path.read_bytes()).hexdigest() != expected["sha256"]
or measured["source_outline_hashes_sha256"] != pinned["source_outline_hashes_sha256"]
or not measured["numerical_passed"]):
raise SystemExit(f"error: {path} differs from the pinned ladder/release hashes or sizes.")
web = path.with_suffix(".woff2")
web_pin = release["web_fonts"][web.name]
if (web.stat().st_size != web_pin["size_bytes"]
or hashlib.sha256(web.read_bytes()).hexdigest() != web_pin["sha256"]):
raise SystemExit(f"error: {web} differs from the pinned variable web font.")
CHECK_WARP
mkdir -p "$stage/$name"
cp -r fonts/warp/ttf fonts/warp/otf fonts/warp/webfonts "$stage/$name/"
cp -r fonts/warp/ttf fonts/warp/otf fonts/warp/webfonts fonts/warp/vf "$stage/$name/"
cp warp/OFL.txt "$stage/$name/OFL.txt"
cp "warp/RELEASE-NOTES-${notes_version}.md" "$stage/$name/RELEASE-NOTES.md"
cp "$out/readability.json" "$stage/$name/readability.json"
cp proofs/warp/release.json "$stage/$name/release.json"
{
echo "# machine-made Warp ${version}"
echo
Expand All @@ -155,16 +192,20 @@ case "$fam" in
echo "machine-made Warp Display: Regular, Italic (titles, opsz 60)."
echo
echo "- ttf/, otf/: the six static fonts"
echo "- webfonts/: WOFF2 of the six fonts"
echo "- webfonts/: WOFF2 of the six static fonts"
echo "- vf/: Roman and Italic variable TTF and WOFF2, weights 300 to 700"
echo "- SHA256SUMS: SHA-256 of every font in this folder"
echo "- readability.json: the OCR readability report of this release"
echo "- RELEASE-NOTES.md: what is in this release"
echo
echo "Licence: SIL Open Font License 1.1, Reserved Font Name \"machine-made\" (OFL.txt)."
echo "Source: https://github.com/machine-made/type"
echo "Specimen: https://machine-made.github.io/type/warp/"
} > "$stage/$name/README.md"
(cd "$stage/$name" && find ttf otf webfonts vf -type f -print0 \
| LC_ALL=C sort -z | xargs -0 sha256sum > SHA256SUMS)
make_zip "$stage" "$out/$name.zip"
cp fonts/warp/webfonts/*.woff2 fonts/warp/ttf/*.ttf "$out/"
cp fonts/warp/webfonts/*.woff2 fonts/warp/ttf/*.ttf fonts/warp/vf/*.ttf fonts/warp/vf/*.woff2 "$out/"
;;
site)
name="machine-made-type-site-${version}"
Expand All @@ -179,6 +220,6 @@ case "$fam" in
;;
esac

(cd "$out" && sha256sum -- * | LC_ALL=C sort -k2 > "$stage/SHA256SUMS" && mv "$stage/SHA256SUMS" SHA256SUMS)
(cd "$out" && find . -maxdepth 1 -type f ! -name SHA256SUMS -print0 | LC_ALL=C sort -z | xargs -0 sha256sum | LC_ALL=C sort -k2 > "$stage/SHA256SUMS" && mv "$stage/SHA256SUMS" SHA256SUMS)
echo "Release files in $out:"
ls -l "$out"
24 changes: 15 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ jobs:
warp:
if: startsWith(inputs.tag || github.ref_name, 'warp-v')
runs-on: ubuntu-24.04
timeout-minutes: 40
timeout-minutes: 240
permissions:
contents: write
id-token: write
Expand Down Expand Up @@ -470,13 +470,16 @@ jobs:
python -m pip install -e ".[test]"
node --version

- name: Build static and variable fonts with numerical gates
working-directory: warp
run: scripts/build.sh

- name: Run tests
working-directory: warp
run: python -m pytest -q

- name: Build fonts
working-directory: warp
run: scripts/build.sh
- name: Check variable font hashes against the release proof
run: cmp proofs/warp/release.json build/warp-vf/release.json

- name: Check that the build is the same as the committed fonts
run: |
Expand All @@ -501,7 +504,7 @@ jobs:
sudo install -m 755 "$RUNNER_TEMP/${name}/fontspector" /usr/local/bin/fontspector
fontspector --version

- name: Check fonts (Fontspector, universal profile)
- name: Check static and variable fonts (Fontspector, universal profile)
working-directory: warp
run: scripts/check.sh fontspector

Expand Down Expand Up @@ -531,12 +534,12 @@ jobs:
exit 1
fi
# A tag that exists already is fine when its commit has the same release files
# (fonts/warp warp) as this commit: that is a re-run after a failed upload, and the
# (fonts/warp warp proofs/warp) as this commit: that is a re-run after a failed upload, and the
# release goes onto that tag. Any other change needs a new version.
existing="$(git ls-remote --tags origin "refs/tags/${RELEASE_TAG}^{}" "refs/tags/${RELEASE_TAG}" | awk '{print $1}' | tail -n 1)"
if [ -n "$existing" ]; then
git fetch --quiet --depth=1 origin "$existing"
if git diff --quiet "$existing" "$GITHUB_SHA" -- fonts/warp warp; then
if git diff --quiet "$existing" "$GITHUB_SHA" -- fonts/warp warp proofs/warp; then
echo "Tag ${RELEASE_TAG} exists already on ${existing} with the same release files. Re-running the release."
exit 0
fi
Expand All @@ -547,8 +550,7 @@ jobs:
git push origin "refs/tags/${RELEASE_TAG}"

- name: Create the release
# gh reads each file argument as a glob. The Warp file names have no
# brackets; any bracket in a future name must be escaped (\[ \]).
# gh reads file arguments as globs; escape the variable-font brackets.
env:
GH_TOKEN: ${{ github.token }}
run: |
Expand All @@ -568,6 +570,10 @@ jobs:
"$OUT/MachineMadeWarp-BoldItalic.ttf" \
"$OUT/MachineMadeWarpDisplay-Regular.ttf" \
"$OUT/MachineMadeWarpDisplay-Italic.ttf" \
"$OUT/MachineMadeWarp\[wght\].ttf" \
"$OUT/MachineMadeWarp-Italic\[wght\].ttf" \
"$OUT/MachineMadeWarp\[wght\].woff2" \
"$OUT/MachineMadeWarp-Italic\[wght\].woff2" \
"$OUT/readability.json" \
"$OUT/SHA256SUMS"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/warp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
build:
runs-on: ubuntu-24.04
# On 19 Nov the tests, two font builds and the fidelity sweep took 40 minutes and were cancelled at the limit.
timeout-minutes: 75
timeout-minutes: 240
defaults:
run:
working-directory: warp
Expand Down
Binary file modified fonts/warp/otf/MachineMadeWarp-Bold.otf
Binary file not shown.
Binary file modified fonts/warp/otf/MachineMadeWarp-BoldItalic.otf
Binary file not shown.
Binary file modified fonts/warp/otf/MachineMadeWarp-Italic.otf
Binary file not shown.
Binary file modified fonts/warp/otf/MachineMadeWarp-Regular.otf
Binary file not shown.
Binary file modified fonts/warp/otf/MachineMadeWarpDisplay-Italic.otf
Binary file not shown.
Binary file modified fonts/warp/otf/MachineMadeWarpDisplay-Regular.otf
Binary file not shown.
Binary file modified fonts/warp/ttf/MachineMadeWarp-Bold.ttf
Binary file not shown.
Binary file modified fonts/warp/ttf/MachineMadeWarp-BoldItalic.ttf
Binary file not shown.
Binary file modified fonts/warp/ttf/MachineMadeWarp-Italic.ttf
Binary file not shown.
Binary file modified fonts/warp/ttf/MachineMadeWarp-Regular.ttf
Binary file not shown.
Binary file modified fonts/warp/ttf/MachineMadeWarpDisplay-Italic.ttf
Binary file not shown.
Binary file modified fonts/warp/ttf/MachineMadeWarpDisplay-Regular.ttf
Binary file not shown.
Binary file added fonts/warp/vf/MachineMadeWarp-Italic[wght].ttf
Binary file not shown.
Binary file added fonts/warp/vf/MachineMadeWarp-Italic[wght].woff2
Binary file not shown.
Binary file added fonts/warp/vf/MachineMadeWarp[wght].ttf
Binary file not shown.
Binary file added fonts/warp/vf/MachineMadeWarp[wght].woff2
Binary file not shown.
Binary file modified fonts/warp/webfonts/MachineMadeWarp-Bold.woff2
Binary file not shown.
Binary file modified fonts/warp/webfonts/MachineMadeWarp-BoldItalic.woff2
Binary file not shown.
Binary file modified fonts/warp/webfonts/MachineMadeWarp-Italic.woff2
Binary file not shown.
Binary file modified fonts/warp/webfonts/MachineMadeWarp-Regular.woff2
Binary file not shown.
Binary file modified fonts/warp/webfonts/MachineMadeWarpDisplay-Italic.woff2
Binary file not shown.
Binary file modified fonts/warp/webfonts/MachineMadeWarpDisplay-Regular.woff2
Binary file not shown.
Loading
Loading