diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08edb53..e09a325 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/extract.py b/extract.py index 0688b16..2d4a439 100644 --- a/extract.py +++ b/extract.py @@ -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 @@ -92,4 +95,4 @@ def transformVariant(input): for ttc in listTtc("data/*.ttc"): print(ttc) - ttc.build() \ No newline at end of file + ttc.build()