Skip to content

Workflow file for this run

name: FontLab CI Export
on:
push:
branches:
- main
jobs:
build:
runs-on: windows-latest
outputs:
fontlab_version: ${{ steps.get_version.outputs.version }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Get FontLab Version
id: get_version
run: |
$url = "https://download.fontlab.com/fontlab-8/upd-win64.php"
$response1 = Invoke-WebRequest -Uri $url -Headers @{"Accept-Language"="en-US,en;q=0.9"} -UserAgent "Mozilla/5.0" -MaximumRedirection 0 -ErrorAction SilentlyContinue
$redirectUrl = $response1.Headers['Location']
$response2 = Invoke-WebRequest -Uri $redirectUrl -Headers @{"Accept-Language"="en-US,en;q=0.9"} -UserAgent "Mozilla/5.0" -ErrorAction SilentlyContinue
$version = [System.IO.Path]::GetFileName($response2.BaseResponse.ResponseUri.AbsoluteUri).Replace('FontLab-8-Win64-Install-', '').Replace('.exe', '')
echo "::set-output name=version::$version"
- name: Cache FontLab Installer
id: cache-installer
uses: actions/cache@v2
with:
path: |
FontLab-Installer.exe
key: ${{ runner.os }}-fontlab-installer-${{ steps.get_version.outputs.version }}
- name: Download FontLab
if: steps.cache-installer.outputs.cache-hit != 'true'
run: |
$url = "https://download.fontlab.com/fontlab-8/upd-win64.php"
$output = "FontLab-Installer.exe"
Invoke-WebRequest -Uri $url -Headers @{"Accept-Language"="en-US,en;q=0.9"} -UserAgent "Mozilla/5.0" -OutFile $output
- name: Install FontLab
run: |
$installer = Get-ChildItem -Path . -Filter "FontLab-Installer.exe" | Select-Object -ExpandProperty FullName
Start-Process -FilePath $installer -ArgumentList "/NOCANCEL /SP- /VERYSILENT /SUPPRESSMSGBOXES" -Wait
- name: Run Build Script
run: |
$fontLabExe = "C:\\Program Files\\FontLab\\FontLab 8\\FontLab8.exe"
$scriptPath = "scripts\\fontlab_export.vfpy"
Start-Process -FilePath $fontLabExe -ArgumentList $scriptPath -Wait
- name: Test Exported Fonts
run: |
# Add your testing commands here
- name: Configure Git
run: |
git config user.name "GitHub Action"
git config user.email "action@github.com"
- name: Commit and Push Exported Fonts
run: |
$outputDirectory = "build"
$distDirectory = "fonts"
if (Test-Path $outputDirectory) {
Move-Item -Path $outputDirectory\\*.ttf -Destination $distDirectory
}
git add $distDirectory\\*.ttf
$commit = git commit -m "Update exported fonts"
if ($commit -ne $null) {
git push
} else {
Write-Output "No new fonts to commit"
}