Debian Codegraph @

.github/workflows/build.yaml

raw symbols SCIP
1 name: Build font and specimen
2
3 on: [push, release]
4
5 jobs:
6 build:
7 runs-on: ubuntu-latest
8 steps:
9 - uses: actions/checkout@v2
10 - name: Set up Python 3.8
11 uses: actions/setup-python@v2
12 with:
13 python-version: 3.8
14 - name: Install sys tools/deps
15 run: |
16 sudo apt-get update
17 sudo apt-get install ttfautohint
18 sudo snap install yq
19 - uses: actions/cache@v2
20 with:
21 path: ./venv/
22 key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements*.txt') }}
23 restore-keys: |
24 ${{ runner.os }}-venv-
25 - name: Do first-run script if necessary
26 run: make .init.stamp
27 if: github.repository != 'googlefonts/Unified-Font-Repository'
28 - uses: stefanzweifel/git-auto-commit-action@v4
29 name: First-run setup
30 if: github.repository != 'googlefonts/Unified-Font-Repository'
31 with:
32 file_pattern: .init.stamp README.md requirements.txt
33 - name: gen zip file name
34 id: zip-name
35 shell: bash
36 # Set the archive name to repo name + "-assets" e.g "MavenPro-assets"
37 run: echo "ZIP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')-fonts" >> $GITHUB_ENV
38 - name: Build font
39 run: make build
40 - name: Check with fontbakery
41 run: make test
42 continue-on-error: true
43 - name: proof
44 run: make proof
45 - name: setup site
46 run: cp scripts/index.html out/index.html
47 - name: Deploy
48 uses: peaceiris/actions-gh-pages@v3
49 if: ${{ github.ref == 'refs/heads/main' }}
50 with:
51 github_token: ${{ secrets.GITHUB_TOKEN }}
52 publish_dir: ./out
53 - name: Archive artifacts
54 uses: actions/upload-artifact@v2
55 with:
56 name: ${{ env.ZIP_NAME }}
57 path: |
58 fonts
59 out
60 outputs:
61 zip_name: ${{ env.ZIP_NAME }}
62 release:
63 # only run if the commit is tagged...
64 if: github.event_name == 'release'
65 # ... and it builds successfully
66 needs:
67 - build
68 runs-on: ubuntu-latest
69 env:
70 ZIP_NAME: ${{ needs.build.outputs.zip_name }}
71 steps:
72 - uses: actions/checkout@v2
73 - name: Download artefact files
74 uses: actions/download-artifact@v2
75 with:
76 name: ${{ env.ZIP_NAME }}
77 path: ${{ env.ZIP_NAME }}
78 - name: Zip files
79 run: zip -r ${{ env.ZIP_NAME }}.zip ${{ env.ZIP_NAME }}
80 - name: Upload binaries to release
81 uses: svenstaro/upload-release-action@v2
82 with:
83 repo_token: ${{ secrets.GITHUB_TOKEN }}
84 file: ${{ env.ZIP_NAME }}.zip
85 asset_name: ${{ env.ZIP_NAME }}.zip
86 tag: ${{ github.ref }}
87 overwrite: true
88 body: "Production ready fonts"