11name : Build font and specimen
22
3- on :
4- workflow_dispatch :
5- pull_request :
6- push :
7- branches :
8- - main
9- - master # for backwards compatibility; use your default branch if different
10- tags :
11- - " *"
12-
3+ on : [push, pull_request, workflow_dispatch]
134permissions : write-all
145
156jobs :
167 build :
178 name : Build and test
189 runs-on : ubuntu-latest
1910 steps :
20- - uses : actions/checkout@v6
21- - name : Set up Python 3.11
22- uses : actions/setup-python@v6
23- id : python
24- with :
25- python-version : " 3.11"
26- - name : Setup fontspector
27- uses : fonttools/setup-fontspector@main
28- env :
11+ - uses : actions/checkout@v4
12+ - name : Set up Python 3.11
13+ uses : actions/setup-python@v6
14+ with :
15+ python-version : " 3.11"
16+ - name : Setup fontspector
17+ uses : fonttools/setup-fontspector@main
18+ env :
2919 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30- - uses : cargo-bins/cargo-binstall@main
31- name : Install cargo binstall
32- - name : Install Rust font tools
33- run : |
34- cargo binstall --no-confirm diffenator3
35- - name : Install toolset
36- run : |
37- sudo apt-get update
38- sudo apt-get install ttfautohint libcairo2-dev python3-cairo-dev pkg-config python3-dev
39- sudo snap install yq
40- - uses : actions/cache@v5
41- with :
42- path : ./venv/
43- key : ${{ runner.os }}-venv${{ steps.python.outputs.python-version }}-${{ hashFiles('**/requirements*.txt') }}
44- restore-keys : |
45- ${{ runner.os }}-venv${{ steps.python.outputs.python-version }}-
46- - name : Set artifact file name
47- id : zip-name
48- shell : bash
49- # Set the archive name to repo name + "-fonts" e.g "radiocanadafonts-fonts.zip"
50- run : echo "ZIP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')-fonts" >> $GITHUB_ENV
20+ with :
21+ version : 1.5.1
5122
52- # If a new release is cut, use the release tag to auto-bump the source files
53- # - name: Bump release
54- # if: github.event_name == 'release'
55- # run: |
56- # . venv/bin/activate
57- # SRCS=$(yq e ".sources[]" sources/config.yaml)
58- # TAG_NAME=${GITHUB_REF/refs\/tags\//}
59- # echo "Bumping $SRCS to $TAG_NAME"
60- # for src in $SRCS
61- # do
62- # bumpfontversion sources/$src --new-version $TAG_NAME;
63- # done
23+ # - name: Install toolset
24+ # run: |
25+ # sudo apt-get update
26+ # sudo apt-get install ttfautohint libcairo2-dev python3-cairo-dev pkg-config python3-dev
27+ # sudo snap install yq
6428
65- - name : Build font
66- run : make build
67- - name : Check with fontspector
68- run : make test
69- continue-on-error : true
70- - name : Generate proofs
71- run : make proof
72- - name : Set up test result site
73- run : cp scripts/index.html out/index.html
74- - name : Collect deployment assets
75- if : ${{ github.ref_name == github.event.repository.default_branch }}
76- uses : actions/upload-pages-artifact@v5
77- with :
78- path : ./out
79- - name : Archive artifacts
80- uses : actions/upload-artifact@v6
81- with :
82- name : ${{ env.ZIP_NAME }}
83- path : |
84- fonts
85- out
29+ - name : Install toolset
30+ run : |
31+ sudo apt-get update
32+ sudo apt-get install -y ttfautohint libcairo2-dev python3-cairo-dev pkg-config python3-dev
33+ sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq
34+ sudo chmod +x /usr/local/bin/yq
35+
36+ - uses : actions/cache@v4
37+ with :
38+ path : ./venv/
39+ key : ${{ runner.os }}-venv-${{ hashFiles('**/requirements*.txt') }}
40+ restore-keys : |
41+ ${{ runner.os }}-venv-
42+ - name : Set artifact file name
43+ id : zip-name
44+ shell : bash
45+ # Set the archive name to repo name + "-fonts" e.g "radiocanadafonts-fonts.zip"
46+ run : echo "ZIP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')-fonts" >> $GITHUB_ENV
47+
48+ # If a new release is cut, use the release tag to auto-bump the source files
49+ # - name: Bump release
50+ # if: github.event_name == 'release'
51+ # run: |
52+ # . venv/bin/activate
53+ # SRCS=$(yq e ".sources[]" sources/config.yaml)
54+ # TAG_NAME=${GITHUB_REF/refs\/tags\//}
55+ # echo "Bumping $SRCS to $TAG_NAME"
56+ # for src in $SRCS
57+ # do
58+ # bumpfontversion sources/$src --new-version $TAG_NAME;
59+ # done
60+
61+ - name : Build font
62+ run : make build
63+ - name : Check with fontspector
64+ run : make test
65+ continue-on-error : true
66+ - name : Generate proofs
67+ run : make proof
68+ - name : Set up test result site
69+ run : cp -a pages/* out
70+ - name : Collect deployment assets
71+ if : ${{ github.ref == 'refs/heads/main' }}
72+ uses : actions/upload-pages-artifact@v3
73+ with :
74+ path : ./out
75+ - name : Archive artifacts
76+ uses : actions/upload-artifact@v4
77+ with :
78+ name : ${{ env.ZIP_NAME }}
79+ path : |
80+ fonts
81+ out
8682 outputs :
8783 zip_name : ${{ env.ZIP_NAME }}
8884
8985 deploy :
9086 name : Deploy results to GitHub Pages
91- if : ${{ github.ref_name == github.event.repository.default_branch }}
87+ if : ${{ github.ref == 'refs/heads/main' }}
9288 needs : build
9389 runs-on : ubuntu-latest
9490 permissions :
10096 steps :
10197 - name : Deploy to GitHub Pages
10298 id : deployment
103- uses : actions/deploy-pages@v5
99+ uses : actions/deploy-pages@v4
104100
105101 # There are two ways a release can be created: either by pushing a tag, or by
106102 # creating a release from the GitHub UI. Pushing a tag does not automatically
@@ -110,16 +106,16 @@ jobs:
110106
111107 release :
112108 name : Release bundle
113- if : ${{ github.ref_type == 'tag' }}
109+ if : contains( github.ref, 'refs/tags/')
114110 needs : build
115111 runs-on : ubuntu-latest
116112 env :
117113 ZIP_NAME : ${{ needs.build.outputs.zip_name }}
118114 GH_TOKEN : ${{ github.token }}
119115 steps :
120- - uses : actions/checkout@v6
116+ - uses : actions/checkout@v4
121117 - name : Use font artifacts from CI
122- uses : actions/download-artifact@v7
118+ uses : actions/download-artifact@v5
123119 with :
124120 name : ${{ env.ZIP_NAME }}
125121 path : ${{ env.ZIP_NAME }}
0 commit comments