Skip to content

Build Millennium Code #26

Build Millennium Code

Build Millennium Code #26

Workflow file for this run

name: Build Millennium Code
on:
workflow_dispatch: # Manual trigger
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
variant: [normal, term]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- 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_OUTPUT
- name: Set up Bun
uses: oven-sh/setup-bun@v2
- name: Copy Build Plan for ${{ matrix.variant }}
run: |
cp private-build-plans.${{ matrix.variant }}.toml private-build-plans.toml
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker Layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-bun-${{ hashFiles('docker/Dockerfile', 'docker/build.sh') }}
restore-keys: |
${{ runner.os }}-buildx-bun-
- name: Build Docker Image with Bun
run: |
DOCKER_BUILDKIT=1 docker buildx build \
--cache-from type=local,src=/tmp/.buildx-cache \
--cache-to type=local,dest=/tmp/.buildx-cache-new,mode=max \
--load \
-t fontcc \
docker/
- name: Move Docker Cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Build Fonts with Bun (${{ matrix.variant }})
run: |
docker run --rm \
-v ${{ github.workspace }}:/work \
-e VERSION_TAG=${{ steps.fetch-release.outputs.release }} \
fontcc ${{ matrix.variant == 'term' && 'ttf::MillenniumCodeTerm' || 'ttf::MillenniumCode' }}
- name: Adjust Permissions
run: |
sudo chmod -R 755 dist
- name: Archive Fonts (${{ matrix.variant }})
run: |
if [ "${{ matrix.variant }}" == "term" ]; then
zip -r Millennium_Code_Term-Fonts-${{ github.run_id }}.zip dist/MillenniumCodeTerm/TTF/*
else
zip -r Millennium_Code-Fonts-${{ github.run_id }}.zip dist/MillenniumCode/TTF/*
fi
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: millennium-code-${{ matrix.variant }}
path: Millennium_Code*.zip
retention-days: 1
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display Structure
run: ls -R artifacts/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ github.run_id }}"
name: "Millennium Code Release ${{ github.run_id }}"
body: |
Millennium Code fonts (normal and terminal spacing variants) built from the latest Iosevka release.
draft: false
prerelease: false
files: artifacts/*/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}