Skip to content
Merged
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
149 changes: 39 additions & 110 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,27 @@ on:
- "*.*.*"

jobs:
build-macos-app:
runs-on: macos-latest
build-application:
runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
- os: macos-latest
NAME: MacOS

- os: windows-latest
NAME: Windows

- os: ubuntu-22.04
NAME: Ubuntu

permissions:
contents: read

steps:
- name: macOS Notarize -- Install Certificates
if: ${{ matrix.NAME == 'MacOS' }}
run: |
echo ${{ secrets.CERTIFICATE_P12 }} | base64 --decode > certificate.p12
security import certificate.p12 -P ${{ secrets.CERTIFICATE_PASSWORD }}
Expand Down Expand Up @@ -53,15 +66,15 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt | tee pip_log.txt
python macos/ensure_universal_wheels.py pip_log.txt
pip install --force build/universal_wheels/*.whl
pip install -r requirements-dev.txt

- name: Run pre-commit
- name: Make and install universal wheels
if: ${{ matrix.NAME == 'MacOS' }}
run: |
pre-commit run --all-files --verbose --show-diff-on-failure
python macos/ensure_universal_wheels.py pip_log.txt
pip install --force build/universal_wheels/*.whl

- name: Build app
- name: Build app with PyInstaller
run: |
pyinstaller FontraPak.spec -y

Expand All @@ -70,9 +83,10 @@ jobs:
pytest

- name: macOS Notarize -- Codesign and Notarize
if: ${{ matrix.NAME == 'MacOS' }}
run: |
APP_PATH="dist/Fontra Pak.app"
DMG_PATH="dist/FontraPak-macOS.dmg"
DMG_PATH="dist/FontraPak-${{ matrix.NAME }}.dmg"

macos/codesign_app.sh "${{ secrets.CODESIGN_NAME }}" "$APP_PATH" macos/entitlements.plist
python macos/build_dmg.py "$APP_PATH" "$DMG_PATH"
Expand All @@ -95,113 +109,34 @@ jobs:

xcrun stapler staple "$DMG_PATH"

- name: Storing macOS Artifacts
uses: actions/upload-artifact@v5
with:
name: FontraPakMacOS
path: ./dist/*.dmg

build-windows-exe:
runs-on: windows-latest

permissions:
contents: read

steps:
- name: Git checkout
uses: actions/checkout@v6

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 20.x
cache: "npm"

- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Patch requirements.txt
if: github.ref_type == 'tag'
run: |
python scripts/patch_requirements.py ${{ github.ref_name }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt

- name: Build exe
run: |
pyinstaller FontraPak.spec -y

- name: Run tests
run: |
pytest

- name: Storing Windows Artifacts
uses: actions/upload-artifact@v5
with:
name: FontraPakWindows
path: ./dist/*.exe

build-linux-binary:
runs-on: ubuntu-22.04

permissions:
contents: read
steps:
- name: Git checkout
uses: actions/checkout@v5

- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: 20.x
cache: "npm"

- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Patch requirements.txt
if: github.ref_type == 'tag'
run: |
python scripts/patch_requirements.py ${{ github.ref_name }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt

- name: Build executable
- name: Zip Windows exe
if: ${{ matrix.NAME == 'Windows' }}
run: |
pyinstaller FontraPak.spec -y
mv dist/Fontra\ Pak dist/fontrapak
cd ./dist
tar -czvf FontraPak-Ubuntu.tgz fontrapak
Compress-Archive -Path "Fontra Pak.exe" -Destination FontraPak-${{ matrix.NAME }}.zip

- name: Run tests
- name: Archive executable with tar
if: ${{ matrix.NAME != 'MacOS' && matrix.NAME != 'Windows' }}
run: |
pytest
cd ./dist
tar -czvf FontraPak-${{ matrix.NAME }}.tgz fontrapak

- name: Storing Ubuntu Artifacts
- name: Storing Artifacts
uses: actions/upload-artifact@v5
with:
name: FontraPakUbuntu
path: ./dist/*.tgz
name: FontraPak-${{ matrix.NAME }}
path: |
./dist/*.dmg
./dist/*.zip
./dist/*.tgz

create-github-release:
runs-on: ubuntu-latest

permissions:
contents: write

needs: [build-macos-app, build-windows-exe, build-linux-binary]
needs: [build-application]
if: github.ref_type == 'tag'

steps:
Expand All @@ -219,16 +154,10 @@ jobs:
with:
path: ./downloaded-artifact

- name: Zip Windows Artifact
run: |
cd ./downloaded-artifact/FontraPakWindows
zip -q FontraPak-Windows.zip "Fontra Pak.exe"

- name: Display structure of downloaded files
run: ls -R
working-directory: ./downloaded-artifact


- name: Extract Latest Changes
run: |
python scripts/extract_latest_changes.py > tmp_latest_changes.txt
Expand All @@ -239,9 +168,9 @@ jobs:
body_path: 'tmp_latest_changes.txt'
token: ${{ secrets.GITHUB_TOKEN }}
files: |
./downloaded-artifact/FontraPakWindows/*.zip
./downloaded-artifact/FontraPakMacOS/*.dmg
./downloaded-artifact/FontraPakUbuntu/*.tgz
./downloaded-artifact/FontraPak-MacOS/*.dmg
./downloaded-artifact/FontraPak-Windows/*.zip
./downloaded-artifact/FontraPak-Ubuntu/*.tgz
draft: true

- name: Update website / Repository Dispatch
Expand Down
2 changes: 1 addition & 1 deletion FontraPak.spec
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ else:
a.zipfiles,
a.datas,
[],
name="Fontra Pak",
name="Fontra Pak" if sys.platform == "win32" else "fontrapak",
debug=False,
bootloader_ignore_signals=False,
strip=False,
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ Fontra Pak is a cross-platform, standalone, bundled [Fontra](https://github.com/

Nightly builds can be downloaded from the topmost [“Build Application”](https://github.com/fontra/fontra-pak/actions) workflow. You need to be signed in to GitHub to be able to download.

## Build locally
## Run locally from source

To build, set up a Python 3.10 (or higher) virtual environment, install the requirements from `requirements.txt`, then run:
To run the main program directly, set up a Python 3.10 (or higher) virtual environment, install the requirements from `requirements.txt`, then run:

python FontraPakMain.py

## Build a self-contained application locally

To build a self-contained application, set up a Python 3.10 (or higher) virtual environment, install the requirements from `requirements.txt` and `requirements-dev.txt`, then run:

pyinstaller FontraPak.spec -y

## How it works

Easy!
Drop a font file onto application icon, or launch the application, and drop a font file onto the drop area. Or use the "New font" button to create a new font.

https://github.com/fontra/fontra-pak/assets/4246121/a4e8054e-995a-4bcc-ac64-5c8a0ea415aa
5 changes: 4 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
pre-commit==4.5.0
pyinstaller==6.17.0
# Use patched fork to work around https://github.com/matthew-brett/delocate/issues/228
git+https://github.com/justvanrossum/delocate.git
# delocate==0.12.0
pytest==9.0.1
4 changes: 0 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ git+https://github.com/fontra/fontra-compile.git
git+https://github.com/fontra/fontra-rcjk.git
git+https://github.com/fontra/fontra-glyphs.git
aiohttp==3.13.2
pyinstaller==6.17.0
# pin setuptools for now to avoid new pkg_resources warning
setuptools==80.8.0 # pinned!
PyQt6==6.7.1
PyQt6-Qt6==6.7.3
PyQt6-sip==13.10.2
# Use patched fork to work around https://github.com/matthew-brett/delocate/issues/228
git+https://github.com/justvanrossum/delocate.git
# delocate==0.12.0
psutil==7.1.3