|
| 1 | +name: Build Unifont |
| 2 | + |
| 3 | +permissions: |
| 4 | + # Required for uploading artifacts |
| 5 | + actions: write |
| 6 | + |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + unifont_version: |
| 11 | + description: 'The Unifont version to build (example: 15.1.01)' |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + name: Unifont BMP TTF |
| 18 | + runs-on: ubuntu-latest |
| 19 | + timeout-minutes: 10 |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout source |
| 23 | + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 |
| 24 | + |
| 25 | + - name: Install required dependencies |
| 26 | + run: | |
| 27 | + sudo apt-get update |
| 28 | + sudo apt-get install -yq --no-install-recommends fontforge |
| 29 | +
|
| 30 | + - name: Download and verify Unifont v${{ inputs.unifont_version }} |
| 31 | + run: | |
| 32 | + readonly BASE_URL='https://unifoundry.com/pub/unifont/unifont-${{ inputs.unifont_version }}' |
| 33 | + readonly SOURCE_TARBALL_NAME='unifont-${{ inputs.unifont_version }}.tar.gz' |
| 34 | +
|
| 35 | + echo "> Fetching Unifont source tarball and its signature..." |
| 36 | + curl -o unifont.tar.gz "$BASE_URL/$SOURCE_TARBALL_NAME" |
| 37 | + curl -o unifont.tar.gz.sig "$BASE_URL/$SOURCE_TARBALL_NAME.sig" |
| 38 | +
|
| 39 | + # Verify according to the instructions at https://unifoundry.com/verify/index.html |
| 40 | + # with a known-good keyring at this repository |
| 41 | + echo "> Asserting Unifont source tarball provenance..." |
| 42 | + echo "Creating root of trust key" |
| 43 | + gpg --batch --quick-generate-key --passphrase '' '41898282+github-actions[bot]@users.noreply.github.com' |
| 44 | + echo "> Importing expected Unifoundry signing keys from unifoundry-keys.gpg" |
| 45 | + gpg --batch --import unifoundry-keys.gpg |
| 46 | + echo "> Extending trust to Unifoundry signing keys by signing with root of trust key" |
| 47 | + gpg --list-keys --with-colons | awk -F: '/^fpr:/ { print $10 }' | while read -r key_fingerprint; do |
| 48 | + gpg --batch --expert --quick-lsign "$key_fingerprint" || true |
| 49 | + done |
| 50 | + echo "> Verifying Unifont source tarball signature" |
| 51 | + gpg --batch --verify unifont.tar.gz.sig unifont.tar.gz |
| 52 | +
|
| 53 | + - name: Extract and build Unifont BMP TTF |
| 54 | + run: | |
| 55 | + tar -xf unifont.tar.gz |
| 56 | + mv 'unifont-${{ inputs.unifont_version }}' unifont |
| 57 | + make -C unifont/font truetype |
| 58 | +
|
| 59 | + - name: Upload generated Unifont BMP TTF as artifact |
| 60 | + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 |
| 61 | + with: |
| 62 | + name: Unifont BMP TTF |
| 63 | + path: unifont/font/compiled/unifont-${{ inputs.unifont_version }}.ttf |
0 commit comments