Google Fonts #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Google Fonts | |
on: | |
push: | |
branches: | |
- debug-google-fonts | |
schedule: | |
- cron: "0 0 * * 0" # weekly | |
workflow_dispatch: | |
jobs: | |
google-fonts: | |
name: ${{ matrix.mode }} | |
if: github.repository == 'Homebrew/homebrew-cask' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- noun: addition | |
mode: add | |
- noun: update | |
mode: update | |
- noun: deletion | |
mode: delete | |
steps: | |
- name: Checkout homebrew/cask-fonts | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Checkout google/fonts | |
uses: actions/checkout@v4 | |
with: | |
repository: google/fonts | |
path: vendor/google-fonts | |
persist-credentials: false | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install Python packages | |
run: pip3 install gftools html2text jinja2 protobuf | |
- name: Configure Git user | |
id: git-user-config | |
uses: Homebrew/actions/git-user-config@master | |
with: | |
username: ${{ (github.event_name == 'workflow_dispatch' && github.actor) || 'BrewTestBot' }} | |
- name: Set up commit signing | |
uses: Homebrew/actions/setup-commit-signing@master | |
with: | |
signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }} | |
- name: Import Google Fonts | |
run: ./developer/bin/import_google_fonts vendor/google-fonts ${{ matrix.mode }} | |
- name: Create pull request with updated files | |
run: | | |
set -euo pipefail | |
if ! git diff --stat --exit-code | |
then | |
git checkout -b "auto-${{ matrix.mode }}-google-fonts" | |
git commit -am "Update Google Fonts" -m "This pull request was created automatically by the [\`google-fonts\`](https://github.com/Homebrew/homebrew-cask/blob/master/.github/workflows/google-fonts.yml) workflow." | |
gh pr create --head "auto-${{ matrix.mode }}-google-fonts" | |
fi | |
env: | |
GIT_COMMITTER_NAME: ${{ steps.git-user-config.outputs.name }} | |
GIT_COMMITTER_EMAIL: ${{ steps.git-user-config.outputs.email }} | |
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }} |