Build Millennium Code #14
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 Millennium Code | |
on: | |
workflow_dispatch: # Manual trigger | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Install jq | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y jq | |
- name: Fetch Latest Iosevka Release | |
id: fetch-release | |
run: | | |
latest_release=$(curl -s https://api.github.com/repos/be5invis/Iosevka/releases/latest | jq -r .tag_name) | |
echo "release=${latest_release}" >> $GITHUB_ENV | |
- name: Clone Iosevka Source | |
run: | | |
git clone --depth=1 --branch ${release} https://github.com/be5invis/Iosevka.git $HOME/Iosevka | |
- name: Cache Docker Layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/docker-cache | |
key: ${{ runner.os }}-docker-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-docker- | |
- name: Build Docker Image | |
run: | | |
mkdir -p /tmp/docker-cache | |
docker build --cache-from /tmp/docker-cache -t fontcc $HOME/Iosevka/docker | |
- name: Cache Bun Dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.bun | |
key: ${{ runner.os }}-bun-${{ hashFiles('private-build-plans.toml') }} | |
restore-keys: | | |
${{ runner.os }}-bun- | |
- name: Build Fonts | |
run: | | |
mkdir -p output | |
docker run --rm \ | |
-v ${{ github.workspace }}:/work \ | |
fontcc ttf::MillenniumCode | |
env: | |
VERSION_TAG: ${release} | |
- name: Adjust Permissions | |
run: | | |
sudo chmod -R 777 dist | |
- name: Archive Fonts | |
run: | | |
zip -r dist/Millennium_Code-Fonts-${{ github.run_id }}.zip dist/MillenniumCode/* | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: "v${{ github.run_id }}" # Unique tag for the release | |
name: "Millennium Code Release ${{ github.run_id }}" | |
body: | | |
Millennium Code fonts built from the latest Iosevka release (${{ env.release }}). | |
draft: false | |
prerelease: false | |
files: dist/Millennium_Code-Fonts-${{ github.run_id }}.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |