-
Notifications
You must be signed in to change notification settings - Fork 68
130 lines (127 loc) · 4.06 KB
/
Copy pathbuild-test.yml
File metadata and controls
130 lines (127 loc) · 4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Build from Glyphs
on:
push:
branches: [main]
tags: ["*"]
pull_request:
types: [opened, synchronize, reopened]
release:
# A release, pre-release, or draft of a release was published
types: [published]
jobs:
build:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: Checkout ${{ github.head_ref || github.ref_name }}
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref || github.ref_name }}
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version-file: .github/python-version.txt
cache: pip
- name: Build variable fonts
run: make build
- name: Build Android fonts
run: make android
- name: Generate artifact name
id: zip-name
uses: alpha-tango-kilo/gha-artifact-name@v1
with:
repo-name: Google Sans Code
overrides: |
build-test: build
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ steps.zip-name.outputs.artifact-name }}
path: |
fonts/
outputs:
artifact-name: ${{ steps.zip-name.outputs.artifact-name }}
tests:
runs-on: ubuntu-22.04
timeout-minutes: 30
needs:
- build
steps:
- name: Checkout ${{ github.head_ref || github.ref_name }}
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref || github.ref_name }}
- name: Download built fonts
uses: actions/download-artifact@v8
with:
name: ${{ needs.build.outputs.artifact-name }}
path: fonts
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version-file: .github/python-version.txt
cache: pip
- name: OpenType Sanitizer checks
uses: f-actions/opentype-sanitizer@v3
with:
path: fonts/**/*.ttf
- name: Shaperglot report
run: |
echo "::group::Set up venv"
python -m venv shaperglot-venv
shaperglot-venv/bin/pip install --upgrade shaperglot
echo "::endgroup::"
shaperglot-venv/bin/shaperglot report fonts/variable/GoogleSansCode[MONO,wght].ttf
- name: Run Fontbakery
id: fontbakery
run: |
mkdir -p venv
touch venv/touchfile build.stamp
make test
- name: Upload Fontbakery report(s)
uses: actions/upload-artifact@v7
# Always upload reports (even during a pipeline fail), so long as Fontbakery completed
if: ${{ !cancelled() && (steps.fontbakery.conclusion == 'success' || steps.fontbakery.conclusion == 'failure') }}
with:
name: Fontbakery reports
path: out/fontbakery
release:
runs-on: ubuntu-22.04
timeout-minutes: 5
needs:
- build
- tests
# Only run on a GitHub release
if: github.event_name == 'release'
permissions:
# Needed for svenstaro/upload-release-action
contents: write
steps:
- name: Checkout ${{ github.head_ref || github.ref_name }}
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref || github.ref_name }}
- name: Download built fonts
uses: actions/download-artifact@v8
with:
name: ${{ needs.build.outputs.artifact-name }}
- name: Create release archives
run: |
cp "$GITHUB_WORKSPACE/OFL.txt" "$GITHUB_WORKSPACE/variable"
cd "$GITHUB_WORKSPACE/variable" \
&& zip "../GoogleSansCode-${GITHUB_REF#refs/*/}.zip" OFL.txt *.ttf
cp "$GITHUB_WORKSPACE/OFL.txt" "$GITHUB_WORKSPACE/android"
cd "$GITHUB_WORKSPACE/android" \
&& zip "../GoogleSansCode-Android-${GITHUB_REF#refs/*/}.zip" OFL.txt *.ttf
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: GoogleSansCode*.zip
file_glob: true
asset_name: ${{ env.RELEASE_ZIP_NAME }}
tag: ${{ github.ref }}
overwrite: true
body: >
Production ready fonts.
See [CHANGELOG.md](https://github.com/googlefonts/googlesans-code/blob/main/CHANGELOG.md) for changes