Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 36 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,40 @@ on:

jobs:
build:
runs-on: ubuntu-latest
container: archlinux:latest
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: pacman -Syu --noconfirm git fontforge curl p7zip jq
- uses: actions/checkout@v2
- name: Grab latest version
run: |
curl -L https://api.github.com/repos/be5invis/Sarasa-Gothic/releases/latest -o api.json
UPSTREAM_VERSION=$(cat api.json | jq -r .tag_name)
DOWNLOAD_URL=$(cat api.json | jq -r '.assets[] | select(.name | test("sarasa-gothic-ttc-(?!unhinted)")) | .browser_download_url')
echo "UPSTREAM_VERSION=$UPSTREAM_VERSION" >> $GITHUB_ENV
echo "DOWNLOAD_URL=$DOWNLOAD_URL" >> $GITHUB_ENV
- name: Download font
run: curl -Lvo /tmp/ttc.7z $DOWNLOAD_URL
- name: Extract font
run: 7z x -odata /tmp/ttc.7z
- name: Run script
run: |
mkdir out
python3 extract.py
- name: Compress font
run: |
cd out
7z a ../out.zip *
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: out
path: out
- name: Upload release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "upstream-${{ env.UPSTREAM_VERSION }}"
prerelease: true
title: Nightly build
files: out.zip
- name: Install dependencies
run: sudo apt install git fontforge curl p7zip-full jq python3 python3-fontforge
- uses: actions/checkout@v2
- name: Grab latest version
run: |
curl -L https://api.github.com/repos/be5invis/Sarasa-Gothic/releases/latest -o api.json
UPSTREAM_VERSION=$(cat api.json | jq -r .tag_name)
DOWNLOAD_URL=$(cat api.json | jq -r '.assets[] | select(.name | test("Sarasa-TTC-(?!Unhinted)")) | select(.content_type|test("application/x-compressed")) | .browser_download_url')
echo "UPSTREAM_VERSION=$UPSTREAM_VERSION" >> $GITHUB_ENV
echo "DOWNLOAD_URL=$DOWNLOAD_URL" >> $GITHUB_ENV
- name: Download font
run: curl -Lvo /tmp/ttc.7z $DOWNLOAD_URL
- name: Extract font
run: 7z x -odata /tmp/ttc.7z
- name: Run script
run: |
mkdir out
python3 extract.py
- name: Compress font
run: |
cd out
7z a ../out.7z * -mx=9 -md=512m -ms=on
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: out
path: out
- name: Upload release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "upstream-${{ env.UPSTREAM_VERSION }}"
prerelease: true
title: Nightly build
files: out.7z
5 changes: 4 additions & 1 deletion extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def edit(self):
if self.variant == "Regular":
enus = enusr
zhcn = zhcnr
if self.variant == "ExtraLight":
enus = enusr + " " + "Light"
zhcn = zhcnr + " " + "Light"
# self.font.fullname = enus
self.font.fontname = enus.replace(" ", "")
self.font.fullname = enus
Expand Down Expand Up @@ -92,4 +95,4 @@ def transformVariant(input):

for ttc in listTtc("data/*.ttc"):
print(ttc)
ttc.build()
ttc.build()