Initial commit: Add project files and GitHub Action #1
This file contains hidden or 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 Font | |
| on: | |
| push: | |
| branches: ["main"] | |
| paths: | |
| - "private-build-plans.toml" | |
| - ".github/workflows/**" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| # 1. Checkout your repository to get the config file | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # 2. Checkout the official Iosevka repository to get the build tools | |
| - name: Checkout Iosevka source | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: be5invis/Iosevka | |
| path: iosevka-src | |
| depth: 1 | |
| # 3. Install system dependencies required by Iosevka | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ttfautohint python3 | |
| # 4. Set up Node.js, which is required by the Iosevka build scripts | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| # 5. Copy your custom build plan into the Iosevka source directory | |
| - name: Copy custom build plan | |
| run: cp private-build-plans.toml iosevka-src/ | |
| # 6. Navigate into the Iosevka directory, install dependencies, and build the font | |
| - name: Install dependencies and build font | |
| run: | | |
| cd iosevka-src | |
| npm install | |
| npm run build -- ttf::IoskeleyMono | |
| # 7. Verify build output exists (More specific check) | |
| - name: Verify build output | |
| run: | | |
| if [ ! -d "iosevka-src/dist/IoskeleyMono/TTF" ] || [ ! -d "iosevka-src/dist/IoskeleyMono/TTF-Unhinted" ]; then | |
| echo "Build output directories (TTF and/or TTF-Unhinted) not found!" | |
| exit 1 | |
| fi | |
| echo "Hinted and Unhinted build directories verified." | |
| # 8. Create separate ZIP archives for hinted and unhinted fonts (MODIFIED STEP) | |
| - name: Package font files into separate archives | |
| run: | | |
| # Package the Hinted fonts | |
| cd iosevka-src/dist/IoskeleyMono/TTF | |
| zip -r ../../../../IoskeleyMono-Hinted.zip . | |
| # Package the Unhinted fonts | |
| cd ../TTF-Unhinted | |
| zip -r ../../../../IoskeleyMono-Unhinted.zip . | |
| # 9. Set the release version number | |
| - name: Set Release Version | |
| id: vars | |
| run: echo "tag=$(date +'%Y.%m.%d')-${{ github.run_number }}" >> $GITHUB_OUTPUT | |
| # 10. Create a new GitHub Release and upload both ZIP files (MODIFIED STEP) | |
| - name: Create Release and Upload Assets | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.vars.outputs.tag }} | |
| name: "Release ${{ steps.vars.outputs.tag }}" | |
| body: | | |
| Automated build triggered by commit ${{ github.sha }}. | |
| Two versions are attached: | |
| - `IoskeleyMono-Hinted.zip`: Fonts with hinting for better rendering on lower-resolution screens. | |
| - `IoskeleyMono-Unhinted.zip`: Raw, unhinted fonts preferred by some users, especially on high-DPI displays. | |
| files: | | |
| IoskeleyMono-Hinted.zip | |
| IoskeleyMono-Unhinted.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |