Skip to content

Commit 3c594b0

Browse files
committed
Merge branch 'main' of https://github.com/SorkinType/Alatsi
2 parents 6557548 + dd7302b commit 3c594b0

File tree

15 files changed

+75904
-75393
lines changed

15 files changed

+75904
-75393
lines changed

.github/workflows/build.yaml

Lines changed: 63 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,47 @@
11
name: Build font and specimen
22

3-
on: [push, release]
3+
on: push
44

55
jobs:
66
build:
7+
name: Build and test
78
runs-on: ubuntu-latest
89
steps:
9-
- uses: actions/checkout@v2
10-
- name: Set up Python 3.8
11-
uses: actions/setup-python@v2
10+
- uses: actions/checkout@v4
11+
- name: Set up Python 3.10
12+
uses: actions/setup-python@v5
1213
with:
13-
python-version: 3.8
14+
python-version: "3.10"
1415
- name: Install sys tools/deps
1516
run: |
1617
sudo apt-get update
1718
sudo apt-get install ttfautohint
1819
sudo snap install yq
19-
- uses: actions/cache@v2
20+
- uses: actions/cache@v4
2021
with:
2122
path: ./venv/
2223
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements*.txt') }}
2324
restore-keys: |
2425
${{ runner.os }}-venv-
25-
- name: Do first-run script if necessary
26-
run: make .init.stamp
27-
if: github.repository != 'googlefonts/googlefonts-project-template'
28-
- uses: stefanzweifel/git-auto-commit-action@v4
29-
name: First-run setup
30-
if: github.repository != 'googlefonts/googlefonts-project-template'
31-
with:
32-
file_pattern: .init.stamp README.md requirements.txt OFL.txt
33-
commit_message: "Personalize for this repo"
3426
- name: gen zip file name
3527
id: zip-name
3628
shell: bash
3729
# Set the archive name to repo name + "-assets" e.g "MavenPro-assets"
3830
run: echo "ZIP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')-fonts" >> $GITHUB_ENV
39-
# If a new release is cut, use the release tag to auto-bump the source files
40-
- name: Bump release
41-
if: github.event_name == 'release'
42-
run: |
43-
. venv/bin/activate
44-
SRCS=$(yq e ".sources[]" sources/config.yaml)
45-
TAG_NAME=${GITHUB_REF/refs\/tags\//}
46-
echo "Bumping $SRCS to $TAG_NAME"
47-
for src in $SRCS
48-
do
49-
bumpfontversion sources/$src --new-version $TAG_NAME;
50-
done
31+
32+
# If a new release is cut, use the release tag to auto-bump the source files
33+
# - name: Bump release
34+
# if: github.event_name == 'release'
35+
# run: |
36+
# . venv/bin/activate
37+
# SRCS=$(yq e ".sources[]" sources/config.yaml)
38+
# TAG_NAME=${GITHUB_REF/refs\/tags\//}
39+
# echo "Bumping $SRCS to $TAG_NAME"
40+
# for src in $SRCS
41+
# do
42+
# bumpfontversion sources/$src --new-version $TAG_NAME;
43+
# done
44+
5145
- name: Build font
5246
run: make build
5347
- name: Check with fontbakery
@@ -58,44 +52,65 @@ jobs:
5852
- name: setup site
5953
run: cp scripts/index.html out/index.html
6054
- name: Deploy
61-
uses: peaceiris/actions-gh-pages@v3
55+
uses: peaceiris/actions-gh-pages@v4
6256
if: ${{ github.ref == 'refs/heads/main' }}
6357
with:
6458
github_token: ${{ secrets.GITHUB_TOKEN }}
6559
publish_dir: ./out
6660
- name: Archive artifacts
67-
uses: actions/upload-artifact@v2
61+
uses: actions/upload-artifact@v4
6862
with:
6963
name: ${{ env.ZIP_NAME }}
7064
path: |
7165
fonts
7266
out
7367
outputs:
7468
zip_name: ${{ env.ZIP_NAME }}
69+
70+
# There are two ways a release can be created: either by pushing a tag, or by
71+
# creating a release from the GitHub UI. Pushing a tag does not automatically
72+
# create a release, so we have to do that ourselves. However, creating a
73+
# release from the GitHub UI *does* push a tag, and we don't want to create
74+
# a new release in that case because one already exists!
75+
7576
release:
76-
# only run if the commit is tagged...
77-
if: github.event_name == 'release'
78-
# ... and it builds successfully
79-
needs:
80-
- build
77+
name: Create and populate release
78+
needs: build
8179
runs-on: ubuntu-latest
80+
if: contains(github.ref, 'refs/tags/')
8281
env:
8382
ZIP_NAME: ${{ needs.build.outputs.zip_name }}
83+
GH_TOKEN: ${{ github.token }}
8484
steps:
85-
- uses: actions/checkout@v2
86-
- name: Download artefact files
87-
uses: actions/download-artifact@v2
85+
- uses: actions/checkout@v4
86+
- name: Download font artefact files
87+
uses: actions/download-artifact@v4
8888
with:
8989
name: ${{ env.ZIP_NAME }}
9090
path: ${{ env.ZIP_NAME }}
91-
- name: Zip files
92-
run: zip -r ${{ env.ZIP_NAME }}.zip ${{ env.ZIP_NAME }}
93-
- name: Upload binaries to release
94-
uses: svenstaro/upload-release-action@v2
95-
with:
96-
repo_token: ${{ secrets.GITHUB_TOKEN }}
97-
file: ${{ env.ZIP_NAME }}.zip
98-
asset_name: ${{ env.ZIP_NAME }}.zip
99-
tag: ${{ github.ref }}
100-
overwrite: true
101-
body: "Production ready fonts"
91+
- name: Copy DESCRIPTION.en_us.html to artefact directory
92+
run: cp documentation/DESCRIPTION.en_us.html ${{ env.ZIP_NAME }}/DESCRIPTION.en_us.html
93+
- name: Copy ARTICLE.en_us.html to artefact directory
94+
run: cp documentation/ARTICLE.en_us.html ${{ env.ZIP_NAME }}/ARTICLE.en_us.html
95+
continue-on-error: true
96+
- name: Copy OFL.txt to artefact directory
97+
run: cp OFL.txt ${{ env.ZIP_NAME }}/OFL.txt
98+
- name: Remove proof/fontbakery stuff from release
99+
run: rm -rf ${{ env.ZIP_NAME }}/out
100+
- name: gen release file name
101+
shell: bash
102+
run: echo "RELEASE_ZIP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')-${{github.ref_name}}" >> $GITHUB_ENV
103+
- name: Create release bundle
104+
run: mv ${{ env.ZIP_NAME }} ${{ env.RELEASE_ZIP_NAME }}; zip -r ${{ env.RELEASE_ZIP_NAME }}.zip ${{ env.RELEASE_ZIP_NAME }}
105+
- name: Check for release
106+
id: create_release
107+
run: |
108+
if ! gh release view ${{ github.ref_name }}; then
109+
git show -s --format=%B ${{ github.ref_name }} | tail -n +4 | gh release create ${{ github.ref_name }} -t ${{ github.ref_name }} -F -
110+
fi
111+
- name: Populate release
112+
run: |
113+
gh release upload ${{ github.ref_name }} ${{ env.RELEASE_ZIP_NAME }}.zip --clobber
114+
- name: Set release live
115+
run: |
116+
gh release edit ${{ github.ref_name }} --draft=false

.templaterc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

Makefile

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,53 @@ build: build.stamp
1818

1919
venv: venv/touchfile
2020

21-
build.stamp: venv .init.stamp sources/config.yaml $(SOURCES)
22-
. venv/bin/activate; rm -rf fonts/; gftools builder sources/config.yaml && touch build.stamp
21+
venv-test: venv-test/touchfile
2322

24-
.init.stamp: venv
25-
. venv/bin/activate; python3 scripts/first-run.py
23+
customize: venv
24+
. venv/bin/activate; python3 scripts/customize.py
25+
26+
build.stamp: venv sources/config.yaml $(SOURCES)
27+
rm -rf fonts
28+
(for config in sources/config*.yaml; do . venv/bin/activate; gftools builder $$config; done) && touch build.stamp
2629

2730
venv/touchfile: requirements.txt
2831
test -d venv || python3 -m venv venv
2932
. venv/bin/activate; pip install -Ur requirements.txt
3033
touch venv/touchfile
3134

32-
test: venv build.stamp
33-
. venv/bin/activate; mkdir -p out/ out/fontbakery; fontbakery check-googlefonts -l WARN --succinct --badges out/badges --html out/fontbakery/fontbakery-report.html --ghmarkdown out/fontbakery/fontbakery-report.md $(shell find fonts/ttf -type f)
35+
venv-test/touchfile: requirements-test.txt
36+
test -d venv-test || python3 -m venv venv-test
37+
. venv-test/bin/activate; pip install -Ur requirements-test.txt
38+
touch venv-test/touchfile
39+
40+
test: venv-test build.stamp
41+
TOCHECK=$$(find fonts/variable -type f 2>/dev/null); if [ -z "$$TOCHECK" ]; then TOCHECK=$$(find fonts/ttf -type f 2>/dev/null); fi ; . venv-test/bin/activate; mkdir -p out/ out/fontbakery; fontbakery check-googlefonts -l WARN --full-lists --succinct --badges out/badges --html out/fontbakery/fontbakery-report.html --ghmarkdown out/fontbakery/fontbakery-report.md $$TOCHECK || echo '::warning file=sources/config.yaml,title=Fontbakery failures::The fontbakery QA check reported errors in your font. Please check the generated report.'
3442

3543
proof: venv build.stamp
36-
. venv/bin/activate; mkdir -p out/ out/proof; gftools gen-html proof $(shell find fonts/ttf -type f) -o out/proof
44+
TOCHECK=$$(find fonts/variable -type f 2>/dev/null); if [ -z "$$TOCHECK" ]; then TOCHECK=$$(find fonts/ttf -type f 2>/dev/null); fi ; . venv/bin/activate; mkdir -p out/ out/proof; diffenator2 proof $$TOCHECK -o out/proof
3745

38-
images: venv build.stamp $(DRAWBOT_OUTPUT)
39-
git add documentation/*.png && git commit -m "Rebuild images" documentation/*.png
46+
images: venv $(DRAWBOT_OUTPUT)
4047

4148
%.png: %.py build.stamp
42-
python3 $< --output $@
49+
. venv/bin/activate; python3 $< --output $@
4350

4451
clean:
4552
rm -rf venv
46-
find . -name "*.pyc" | xargs rm delete
53+
find . -name "*.pyc" -delete
54+
55+
update-project-template:
56+
npx update-template https://github.com/googlefonts/googlefonts-project-template/
57+
58+
update: venv venv-test
59+
venv/bin/pip install --upgrade pip-tools
60+
# See https://pip-tools.readthedocs.io/en/latest/#a-note-on-resolvers for
61+
# the `--resolver` flag below.
62+
venv/bin/pip-compile --upgrade --verbose --resolver=backtracking requirements.in
63+
venv/bin/pip-sync requirements.txt
4764

48-
update-ufr:
49-
npx update-template https://github.com/googlefonts/Unified-Font-Repository/
65+
venv-test/bin/pip install --upgrade pip-tools
66+
venv-test/bin/pip-compile --upgrade --verbose --resolver=backtracking requirements-test.in
67+
venv-test/bin/pip-sync requirements-test.txt
5068

51-
update:
52-
pip install --upgrade $(dependency); pip freeze > requirements.txt
69+
git commit -m "Update requirements" requirements.txt requirements-test.txt
70+
git push

OFL.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Copyright 2019 The Alatsi Project Authors (https://github.com/SorkinType/Alatsi)
1+
Copyright 2024 The Alatsi Project Authors (https://github.com/SorkinType/Alatsi)
22

33
This Font Software is licensed under the SIL Open Font License, Version 1.1.
44
This license is copied below, and is also available with a FAQ at:
5-
https://scripts.sil.org/OFL
5+
https://openfontlicense.org
66

77

88
-----------------------------------------------------------
@@ -90,4 +90,4 @@ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
9090
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
9191
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9292
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93-
OTHER DEALINGS IN THE FONT SOFTWARE.
93+
OTHER DEALINGS IN THE FONT SOFTWARE.

fonts/otf/Alatsi-Regular.otf

292 KB
Binary file not shown.

fonts/ttf/Alatsi-Regular.ttf

298 KB
Binary file not shown.

fonts/webfonts/Alatsi-Regular.woff2

106 KB
Binary file not shown.

requirements-test.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fontbakery[googlefonts]>=0.9.2
2+
gftools[qa]>=0.9.23

requirements.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fontmake>=3.9.0
2+
gftools[qa]>=0.9.54
3+
drawbot-skia>=0.5.0
4+
sh>=2.0.6
5+
bumpfontversion>=0.4.1
6+
diffenator2>=0.3.8

0 commit comments

Comments
 (0)