Skip to content

Commit

Permalink
Build issues etc
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Mar 20, 2024
1 parent 5512659 commit d81511c
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 70 deletions.
120 changes: 72 additions & 48 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
name: Build font and specimen

on: [push, release]
on: push

jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set up latest harfbuzz
uses: notofonts/install-harfbuzz-action@main
- name: Install sys tools/deps
run: |
sudo apt-get update
sudo apt-get install ttfautohint
sudo snap install yq
- uses: actions/cache@v2
- name: Set up latest harfbuzz
uses: notofonts/install-harfbuzz-action@main
- uses: actions/cache@v4
with:
path: ./venv/
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements*.txt') }}
Expand All @@ -29,66 +30,89 @@ jobs:
shell: bash
# Set the archive name to repo name + "-assets" e.g "MavenPro-assets"
run: echo "ZIP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')-fonts" >> $GITHUB_ENV
# If a new release is cut, use the release tag to auto-bump the source files
- name: Bump release
if: github.event_name == 'release'
run: |
. venv/bin/activate
SRCS=$(yq e ".sources[]" sources/config.yaml)
TAG_NAME=${GITHUB_REF/refs\/tags\//}
echo "Bumping $SRCS to $TAG_NAME"
for src in $SRCS
do
bumpfontversion sources/$src --new-version $TAG_NAME;
done

# If a new release is cut, use the release tag to auto-bump the source files
# - name: Bump release
# if: github.event_name == 'release'
# run: |
# . venv/bin/activate
# SRCS=$(yq e ".sources[]" sources/config.yaml)
# TAG_NAME=${GITHUB_REF/refs\/tags\//}
# echo "Bumping $SRCS to $TAG_NAME"
# for src in $SRCS
# do
# bumpfontversion sources/$src --new-version $TAG_NAME;
# done

- name: Build font
run: make build
- name: Check with fontbakery
run: make test
continue-on-error: true
# - name: proof
# run: make proof
# - name: setup site
# run: cp scripts/index.html out/index.html
# - name: Deploy
# uses: peaceiris/actions-gh-pages@v3
# if: ${{ github.ref == 'refs/heads/main' }}
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./out
#- name: proof
# run: make proof
- name: setup site
run: cp scripts/index.html out/index.html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
- name: Archive artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.ZIP_NAME }}
path: |
fonts
out
outputs:
zip_name: ${{ env.ZIP_NAME }}

# There are two ways a release can be created: either by pushing a tag, or by
# creating a release from the GitHub UI. Pushing a tag does not automatically
# create a release, so we have to do that ourselves. However, creating a
# release from the GitHub UI *does* push a tag, and we don't want to create
# a new release in that case because one already exists!

release:
# only run if the commit is tagged...
if: github.event_name == 'release'
# ... and it builds successfully
needs:
- build
name: Create and populate release
needs: build
runs-on: ubuntu-latest
if: contains(github.ref, 'refs/tags/')
env:
ZIP_NAME: ${{ needs.build.outputs.zip_name }}
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v2
- name: Download artefact files
uses: actions/download-artifact@v2
- uses: actions/checkout@v4
- name: Download font artefact files
uses: actions/download-artifact@v4
with:
name: ${{ env.ZIP_NAME }}
path: ${{ env.ZIP_NAME }}
- name: Zip files
run: zip -r ${{ env.ZIP_NAME }}.zip ${{ env.ZIP_NAME }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.ZIP_NAME }}.zip
asset_name: ${{ env.ZIP_NAME }}.zip
tag: ${{ github.ref }}
overwrite: true
body: "Production ready fonts"
- name: Copy DESCRIPTION.en_us.html to artefact directory
run: cp documentation/DESCRIPTION.en_us.html ${{ env.ZIP_NAME }}/DESCRIPTION.en_us.html
- name: Copy ARTICLE.en_us.html to artefact directory
run: cp documentation/ARTICLE.en_us.html ${{ env.ZIP_NAME }}/ARTICLE.en_us.html
continue-on-error: true
- name: Copy OFL.txt to artefact directory
run: cp OFL.txt ${{ env.ZIP_NAME }}/OFL.txt
- name: Remove proof/fontbakery stuff from release
run: rm -rf ${{ env.ZIP_NAME }}/out
- name: gen release file name
shell: bash
run: echo "RELEASE_ZIP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')-${{github.ref_name}}" >> $GITHUB_ENV
- name: Create release bundle
run: mv ${{ env.ZIP_NAME }} ${{ env.RELEASE_ZIP_NAME }}; zip -r ${{ env.RELEASE_ZIP_NAME }}.zip ${{ env.RELEASE_ZIP_NAME }}
- name: Check for release
id: create_release
run: |
if ! gh release view ${{ github.ref_name }}; then
git show -s --format=%B ${{ github.ref_name }} | tail -n +4 | gh release create ${{ github.ref_name }} -t ${{ github.ref_name }} -F -
fi
- name: Populate release
run: |
gh release upload ${{ github.ref_name }} ${{ env.RELEASE_ZIP_NAME }}.zip --clobber
- name: Set release live
run: |
gh release edit ${{ github.ref_name }} --draft=false
12 changes: 0 additions & 12 deletions DESCRIPTION.en_us.html

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SOURCES=sources/TasSh.glyphs
FAMILY=TAS School Hand
SOURCES=sources/AuQldHand.glyphs
FAMILY=Edu QLD Hand
DRAWBOT_SCRIPTS=$(shell ls documentation/*.py)
DRAWBOT_OUTPUT=$(shell ls documentation/*.py | sed 's/\.py/.png/g')

Expand Down
2 changes: 1 addition & 1 deletion OFL.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2023 The Tasschoolhand Project Authors (https://github.com/googlefonts/googlefonts-project-template)
Copyright 2023 The TAS School Hand Australia Project Authors (https://github.com/SorkinType/TASSchoolhandAustralia)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fontmake>=2.4
fontbakery>=0.8.11
gftools @ git+https://github.com/googlefonts/gftools@builder2
gftools @ git+https://github.com/googlefonts/gftools@main
fontprimer @ git+https://github.com/simoncozens/fontprimer
gftools[qa]>=0.9.23
drawbot-skia>=0.4.8
Expand Down
8 changes: 4 additions & 4 deletions sources/TasSh.glyphs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ value = m01;
}
);
date = "2023-09-30 03:30:45 +0000";
familyName = TasSh;
familyName = "Edu TAS Hand";
featurePrefixes = (
{
automatic = 1;
Expand Down Expand Up @@ -133447,20 +133447,20 @@ value = "Tina and Corey Anderson, Eben Sorkin, Mirko Velimirovic";
},
{
key = designerURL;
value = "https://github.com/SorkinType/TASSchoolHandAustralia/";
value = "https://github.com/MezMerrit/AU-School-Handwriting-Fonts";
},
{
key = licenses;
values = (
{
language = dflt;
value = "This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is available with a FAQ at: https://scripts.sil.org/OFL";
value = "This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is available with a FAQ at: https://openfontlicense.org";
}
);
},
{
key = licenseURL;
value = "https://scripts.sil.org/OFL";
value = "https://openfontlicense.org/";
},
{
key = manufacturers;
Expand Down
5 changes: 3 additions & 2 deletions sources/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
recipeProvider: fontprimer
sources:
- TasSh.glyphs
shortFamilyName: TAS
- TasSh.glyphs
familyName: Edu TAS Hand
shortFamilyName: Edu TAS
variants:
- name: Precursive
alias: Pre
Expand Down

0 comments on commit d81511c

Please sign in to comment.