Skip to content

Commit

Permalink
Add upstream check
Browse files Browse the repository at this point in the history
  • Loading branch information
Finomnis committed Nov 12, 2023
1 parent d59c437 commit f350a27
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/upstream_font_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check for new upstream font data
on:
pull_request:
branches: [main]
push:
branches: [main]
schedule:
- cron: '0 0 * * 0'
jobs:
check_upstream_changes:
name: Check upstream changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable

- uses: Check generated fonts file
run: ./regenerate_fonts_file_from_upstream.sh --check --hide-progress
28 changes: 28 additions & 0 deletions regenerate_fonts_file_from_upstream.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -eu

SCRIPTPATH=$(
cd "$(dirname "$(readlink -f "$0")")" || exit 1
pwd -P
)
cd "$SCRIPTPATH/tools/generate_fonts_file"

TMP_DIR=$(mktemp -d)

# check if tmp dir was created
if [[ ! "$TMP_DIR" || ! -d "$TMP_DIR" ]]; then
echo "Could not create temp dir"
exit 1
fi

# Remove temp dir on exit
function cleanup {
rm -rf "$TMP_DIR"
echo "Deleted temp working directory $TMP_DIR"
}
trap cleanup EXIT

curl --no-progress-meter --fail-with-body --output-dir "$TMP_DIR" -O https://raw.githubusercontent.com/olikraus/u8g2/master/csrc/u8g2_fonts.c

cargo run --release -- "$@" "$TMP_DIR/u8g2_fonts.c" "$SCRIPTPATH/src/fonts.rs"

0 comments on commit f350a27

Please sign in to comment.