Skip to content

Commit 94863c5

Browse files
committed
Revert "Rest of merge (to be reverted)"
This reverts commit 35dd0d3.
1 parent 35dd0d3 commit 94863c5

File tree

3 files changed

+172
-30
lines changed

3 files changed

+172
-30
lines changed

.github/workflows/build.yaml

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Build font and specimen
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build and test
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Set up Python 3.10
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version: "3.10"
15+
- name: Install sys tools/deps
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install ttfautohint
19+
sudo snap install yq
20+
- uses: actions/cache@v4
21+
with:
22+
path: ./venv/
23+
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements*.txt') }}
24+
restore-keys: |
25+
${{ runner.os }}-venv-
26+
- name: gen zip file name
27+
id: zip-name
28+
shell: bash
29+
# Set the archive name to repo name + "-assets" e.g "MavenPro-assets"
30+
run: echo "ZIP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')-fonts" >> $GITHUB_ENV
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+
45+
- name: Build font
46+
run: make build
47+
- name: Check with fontbakery
48+
run: make test
49+
continue-on-error: true
50+
- name: proof
51+
run: make proof
52+
- name: setup site
53+
run: cp scripts/index.html out/index.html
54+
- name: Deploy
55+
uses: peaceiris/actions-gh-pages@v4
56+
if: ${{ github.ref == 'refs/heads/main' }}
57+
with:
58+
github_token: ${{ secrets.GITHUB_TOKEN }}
59+
publish_dir: ./out
60+
- name: Archive artifacts
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: ${{ env.ZIP_NAME }}
64+
path: |
65+
fonts
66+
out
67+
outputs:
68+
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+
76+
release:
77+
name: Create and populate release
78+
needs: build
79+
runs-on: ubuntu-latest
80+
if: contains(github.ref, 'refs/tags/')
81+
env:
82+
ZIP_NAME: ${{ needs.build.outputs.zip_name }}
83+
GH_TOKEN: ${{ github.token }}
84+
steps:
85+
- uses: actions/checkout@v4
86+
- name: Download font artefact files
87+
uses: actions/download-artifact@v4
88+
with:
89+
name: ${{ env.ZIP_NAME }}
90+
path: ${{ env.ZIP_NAME }}
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

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Build Debian Package
2020
run: scripts/prepare-deb.sh
2121
- name: Build
22-
run: make dist
22+
run: make -f private-build/Makefile dist
2323
- name: Release
2424
uses: softprops/[email protected]
2525
with:

Makefile

+55-29
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,70 @@
1-
ARCHIVE = sudo.zip
2-
DISTDIR = dist
3-
FONTDIR = sudo
4-
prefix = /usr/local
1+
SOURCES=$(shell python3 scripts/read-config.py --sources )
2+
FAMILY=$(shell python3 scripts/read-config.py --family )
3+
DRAWBOT_SCRIPTS=$(shell ls documentation/*.py)
4+
DRAWBOT_OUTPUT=$(shell ls documentation/*.py | sed 's/\.py/.png/g')
55

6-
.PHONY: all
7-
all: build
6+
help:
7+
@echo "###"
8+
@echo "# Build targets for $(FAMILY)"
9+
@echo "###"
10+
@echo
11+
@echo " make build: Builds the fonts and places them in the fonts/ directory"
12+
@echo " make test: Tests the fonts with fontbakery"
13+
@echo " make proof: Creates HTML proof documents in the proof/ directory"
14+
@echo " make images: Creates PNG specimen images in the documentation/ directory"
15+
@echo
816

17+
build: build.stamp
918

10-
.PHONY: build
11-
build: $(FONTDIR)
19+
venv: venv/touchfile
1220

21+
venv-test: venv-test/touchfile
1322

14-
.PHONY: clean
15-
clean:
16-
$(MAKE) -C $(FONTDIR) clean
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
1729

30+
venv/touchfile: requirements.txt
31+
test -d venv || python3 -m venv venv
32+
. venv/bin/activate; pip install -Ur requirements.txt
33+
touch venv/touchfile
1834

19-
.PHONY: dist
20-
dist: webfonts $(DISTDIR)/$(ARCHIVE)
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
2139

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.'
2242

23-
.PHONY: $(FONTDIR)
24-
$(FONTDIR):
25-
$(MAKE) -C $@
43+
proof: venv build.stamp
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
2645

46+
images: venv $(DRAWBOT_OUTPUT)
2747

28-
$(DISTDIR)/$(ARCHIVE): $(FONTDIR)
29-
if test -e $(DISTDIR); then \
30-
rm -f $(DISTDIR)/$(ARCHIVE); \
31-
else \
32-
mkdir $(DISTDIR); \
33-
fi
34-
zip -r $(DISTDIR)/$(ARCHIVE) $(FONTDIR)/ --exclude "*.DS_Store" "*Makefile"
48+
%.png: %.py build.stamp
49+
. venv/bin/activate; python3 $< --output $@
50+
51+
clean:
52+
rm -rf venv
53+
find . -name "*.pyc" -delete
3554

55+
update-project-template:
56+
npx update-template https://github.com/googlefonts/googlefonts-project-template/
3657

37-
.PHONY: install-debian
38-
install-debian:
39-
$(MAKE) -C $(FONTDIR) install-debian
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
4064

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
4168

42-
.PHONY: webfonts
43-
webfonts:
44-
$(MAKE) -C $(FONTDIR) webfonts
69+
git commit -m "Update requirements" requirements.txt requirements-test.txt
70+
git push

0 commit comments

Comments
 (0)