Skip to content

Fixed FL8 runner

Fixed FL8 runner #24

Workflow file for this run

name: FontLab CI Export
on:
push:
branches:
- main
env:
GITHUB_STATE: ${{ github.workspace }}/state.txt
GITHUB_OUTPUT: ${{ github.workspace }}/output.txt
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"
$response = Invoke-WebRequest -Uri $url -Headers @{"Accept-Language"="en-US,en;q=0.9"} -UserAgent "Mozilla/5.0" -MaximumRedirection 0 -ErrorAction SilentlyContinue -SkipHttpErrorCheck
$redirectUrl = $response.Headers['Location']
if ($null -eq $redirectUrl) {
throw "Could not find the redirect URL in the response headers."
}
$version = [System.IO.Path]::GetFileName($redirectUrl).Replace('FontLab-8-Win64-Install-', '').Replace('.exe', '')
echo "version=$version" >> $env:GITHUB_OUTPUT
- 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: Allow FontLab to run
run: |
$appItExe = "scripts\\fontlab_run.exe"
Start-Process -FilePath $appItExe
- name: Run Build Script
run: |
$fontLabExe = "C:\\Program Files\\FontLab\\FontLab 8\\FontLab 8.exe"
$scriptPath = "scripts\\fontlab_export.vfpy"
$configPath = "scripts\\fontlab_build.yaml"
Start-Process -FilePath $fontLabExe -ArgumentList $scriptPath $configPath -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"
}