Skip to content

Build All Formats and Release #3

Build All Formats and Release

Build All Formats and Release #3

Workflow file for this run

name: Build All Formats and Release
on:
push:
tags:
- v*
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
matrix:
config: [
{name: normal-liga, args: "--normal --liga"},
{name: normal-no-liga, args: "--normal --no-liga"},
{name: liga, args: "--liga"},
{name: no-liga, args: "--no-liga"}
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: './requirements.txt'
- run: pip install -r requirements.txt
- name: Build fonts
run: |
python build.py --archive --cn-both --hinted ${{ matrix.config.args }}
python build.py --archive --cn-both --no-hinted --cache ${{ matrix.config.args }}
- uses: actions/upload-artifact@v4
with:
name: release-artifacts-${{ matrix.config.name }}
path: fonts/archive/*
create-release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: release-artifacts*
path: release
- name: Release artifacts
run: |
TAG="${{ github.ref_name }}"
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
TAG="v$(date +%s)"
fi
sed -i "s|https://<url>|https://github.com/subframe7536/maple-font/releases/download/${TAG//\//\\/}|g" .github/release_template.md
gh release create "$TAG" release/**/*.* --notes-file .github/release_template.md --draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}