Build and Release [Weekly] #143
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: Build and Release [Weekly] | |
on: | |
schedule: | |
- cron: "0 0 * * 0" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: "0" | |
- name: Enable PNPM | |
uses: pnpm/action-setup@v2 | |
- name: Set node version to 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
cache: "pnpm" | |
- name: Install | |
run: pnpm install --frozen-lockfile | |
- name: Fetch API # Calls Google Font Metadata to fetch the latest data from Google's Developer API | |
run: pnpm --filter scripts exec gfm generate $GOOGLE_API_KEY | |
env: | |
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
- name: Parse API # Process generated API data | |
run: pnpm --filter scripts exec gfm parse | |
- name: Build fonts | |
run: pnpm run build:google | |
- name: Generate fontlist | |
run: pnpm run util:fontlist | |
- name: Generate Algolia index | |
run: pnpm run util:algolia | |
env: | |
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }} | |
- name: Lint files | |
run: pnpm run lint | |
- name: Format files | |
run: pnpm run format | |
- name: Stage, commit and push files | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_user_name: "fontsource-bot" | |
commit_user_email: "83556432+fontsource-bot@users.noreply.github.com" | |
commit_author: "fontsource-bot <83556432+fontsource-bot@users.noreply.github.com>" | |
commit_message: "chore(build): update packages [Weekly]" | |
continue-on-error: true | |
- name: Check font files # Detects if all binaries are downloaded successfully and in the right place | |
run: pnpm run util:run-check | |
- name: If error, commit again before publishing | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_user_name: "fontsource-bot" | |
commit_user_email: "83556432+fontsource-bot@users.noreply.github.com" | |
commit_author: "fontsource-bot <83556432+fontsource-bot@users.noreply.github.com>" | |
commit_message: "chore(build): resolve file check errors [Weekly]" | |
continue-on-error: true | |
- name: Configure CI Git | |
run: | | |
git config --global user.email "83556432+fontsource-bot@users.noreply.github.com" | |
git config --global user.name "fontsource-bot" | |
- name: Publish package | |
run: pnpm run deploy:ci | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |