Simplify building procedures. #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build on Windows | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: 'pip' # caching pip dependencies | |
- name: Build | |
shell: pwsh | |
run: | | |
Install-Module -Name PSComputerManagementZp -Force | |
Import-Module PSComputerManagementZp | |
choco install fontforge --yes --limitoutput --force | |
Add-PathToCurrentProcessEnvPath -Path "C:\Program Files (x86)\FontForgeBuilds\bin" | |
pip install gftools fonttools[woff] | |
$hash = Get-FileHash -Path ./Output/JetBrainsMonoNerdFont-Regular.ttf -Algorithm MD5 | |
. ".\build.ps1" | |
$newHash = Get-FileHash -Path ./Output/JetBrainsMonoNerdFont-Regular.ttf -Algorithm MD5 | |
if ($hash.Hash -eq $newHash.Hash) { | |
Write-Host "MD5 hash of font file unchanged, no changes detected." | |
Write-Host "The MD5 is $($hash.Hash)" | |
}else{ | |
Write-Host "MD5 hash of font file changed, pushing to repository..." | |
Write-Host "The old MD5 is $($hash.Hash)" | |
Write-Host "The new MD5 is $($newHash.Hash)" | |
} | |