Skip to content

Commit bb036a2

Browse files
authored
Update build.yaml
1 parent 8777954 commit bb036a2

1 file changed

Lines changed: 69 additions & 62 deletions

File tree

.github/workflows/build.yaml

Lines changed: 69 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ on:
66
push:
77
branches:
88
- main
9+
- dev
910
tags:
10-
- '*'
11+
- "*"
1112

1213
permissions: write-all
1314

@@ -16,72 +17,78 @@ jobs:
1617
name: Build and test
1718
runs-on: ubuntu-latest
1819
steps:
19-
- uses: actions/checkout@v6
20-
- name: Set up Python 3.11
21-
uses: actions/setup-python@v6
22-
with:
23-
python-version: "3.11"
24-
- name: Setup fontspector
25-
uses: fonttools/setup-fontspector@main
26-
env:
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:
2729
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28-
- name: Install toolset
29-
run: |
30-
sudo apt-get update
31-
sudo apt-get install ttfautohint libcairo2-dev python3-cairo-dev pkg-config python3-dev
32-
sudo snap install yq
33-
- uses: actions/cache@v4
34-
with:
35-
path: ./venv/
36-
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements*.txt') }}
37-
restore-keys: |
38-
${{ runner.os }}-venv-
39-
- name: Set artifact file name
40-
id: zip-name
41-
shell: bash
42-
# Set the archive name to repo name + "-fonts" e.g "radiocanadafonts-fonts.zip"
43-
run: echo "ZIP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')-fonts" >> $GITHUB_ENV
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
4451

45-
# If a new release is cut, use the release tag to auto-bump the source files
46-
# - name: Bump release
47-
# if: github.event_name == 'release'
48-
# run: |
49-
# . venv/bin/activate
50-
# SRCS=$(yq e ".sources[]" sources/config.yaml)
51-
# TAG_NAME=${GITHUB_REF/refs\/tags\//}
52-
# echo "Bumping $SRCS to $TAG_NAME"
53-
# for src in $SRCS
54-
# do
55-
# bumpfontversion sources/$src --new-version $TAG_NAME;
56-
# done
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
5764

58-
- name: Build font
59-
run: make build
60-
- name: Check with fontspector
61-
run: make test
62-
continue-on-error: true
63-
- name: Generate proofs
64-
run: make proof
65-
- name: Set up test result site
66-
run: cp scripts/index.html out/index.html
67-
- name: Collect deployment assets
68-
if: ${{ github.ref == 'refs/heads/main' }}
69-
uses: actions/upload-pages-artifact@v4
70-
with:
71-
path: ./out
72-
- name: Archive artifacts
73-
uses: actions/upload-artifact@v4
74-
with:
75-
name: ${{ env.ZIP_NAME }}
76-
path: |
77-
fonts
78-
out
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
7986
outputs:
8087
zip_name: ${{ env.ZIP_NAME }}
8188

8289
deploy:
8390
name: Deploy results to GitHub Pages
84-
if: ${{ github.ref == 'refs/heads/main' }}
91+
if: ${{ github.ref_name == github.event.repository.default_branch }}
8592
needs: build
8693
runs-on: ubuntu-latest
8794
permissions:
@@ -93,7 +100,7 @@ jobs:
93100
steps:
94101
- name: Deploy to GitHub Pages
95102
id: deployment
96-
uses: actions/deploy-pages@v4
103+
uses: actions/deploy-pages@v5
97104

98105
# There are two ways a release can be created: either by pushing a tag, or by
99106
# creating a release from the GitHub UI. Pushing a tag does not automatically
@@ -103,7 +110,7 @@ jobs:
103110

104111
release:
105112
name: Release bundle
106-
if: contains(github.ref, 'refs/tags/')
113+
if: ${{ github.ref_type == 'tag' }}
107114
needs: build
108115
runs-on: ubuntu-latest
109116
env:
@@ -112,7 +119,7 @@ jobs:
112119
steps:
113120
- uses: actions/checkout@v6
114121
- name: Use font artifacts from CI
115-
uses: actions/download-artifact@v5
122+
uses: actions/download-artifact@v7
116123
with:
117124
name: ${{ env.ZIP_NAME }}
118125
path: ${{ env.ZIP_NAME }}

0 commit comments

Comments
 (0)