From ca38ca910eb9b3efa2be39e33e7760025928efa8 Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Mon, 15 Dec 2025 15:14:11 +0100 Subject: [PATCH 1/8] Adjust output name to expectations on Linuxy platforms --- FontraPak.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FontraPak.spec b/FontraPak.spec index cc67c7e..4f7af1d 100644 --- a/FontraPak.spec +++ b/FontraPak.spec @@ -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, From 2e2a96a0b0cbd9f49a6c346898d23df5d5db704f Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Mon, 15 Dec 2025 15:14:37 +0100 Subject: [PATCH 2/8] Fold three platform jobs into one --- .github/workflows/python-app.yml | 149 ++++++++----------------------- 1 file changed, 39 insertions(+), 110 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 9128539..8d86433 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -10,14 +10,27 @@ on: - "*.*.*" jobs: - build-macos-app: - runs-on: macos-latest + build-applications: + 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 }} @@ -53,15 +66,15 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt | tee pip_log.txt + + - name: Make and install universal wheels + if: ${{ matrix.NAME == "MacOS" }} + run: | 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 - run: | - pre-commit run --all-files --verbose --show-diff-on-failure - - - name: Build app + - name: Build app with PyInstaller run: | pyinstaller FontraPak.spec -y @@ -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" @@ -95,105 +109,26 @@ 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 + zip -q FontraPak-${{ matrix.NAME }}.zip "Fontra Pak.exe" - - 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 @@ -201,7 +136,7 @@ jobs: permissions: contents: write - needs: [build-macos-app, build-windows-exe, build-linux-binary] + needs: [build-applications] if: github.ref_type == 'tag' steps: @@ -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 @@ -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 From 3e552d8f05b83223eb9adb840e00b22381d546cf Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Mon, 15 Dec 2025 15:17:12 +0100 Subject: [PATCH 3/8] Fix syntax --- .github/workflows/python-app.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 8d86433..376abac 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -30,7 +30,7 @@ jobs: steps: - name: macOS Notarize -- Install Certificates - if: ${{ matrix.NAME == "MacOS" }} + if: ${{ matrix.NAME == 'MacOS' }} run: | echo ${{ secrets.CERTIFICATE_P12 }} | base64 --decode > certificate.p12 security import certificate.p12 -P ${{ secrets.CERTIFICATE_PASSWORD }} @@ -68,7 +68,7 @@ jobs: pip install -r requirements.txt | tee pip_log.txt - name: Make and install universal wheels - if: ${{ matrix.NAME == "MacOS" }} + if: ${{ matrix.NAME == 'MacOS' }} run: | python macos/ensure_universal_wheels.py pip_log.txt pip install --force build/universal_wheels/*.whl @@ -83,7 +83,7 @@ jobs: pytest - name: macOS Notarize -- Codesign and Notarize - if: ${{ matrix.NAME == "MacOS" }} + if: ${{ matrix.NAME == 'MacOS' }} run: | APP_PATH="dist/Fontra Pak.app" DMG_PATH="dist/FontraPak-${{ matrix.NAME }}.dmg" @@ -110,13 +110,13 @@ jobs: xcrun stapler staple "$DMG_PATH" - name: Zip Windows exe - if: ${{ matrix.NAME == "Windows" }} + if: ${{ matrix.NAME == 'Windows' }} run: | cd ./dist zip -q FontraPak-${{ matrix.NAME }}.zip "Fontra Pak.exe" - name: Archive executable with tar - if: ${{ matrix.NAME != "MacOS" && matrix.NAME != "Windows" }} + if: ${{ matrix.NAME != 'MacOS' && matrix.NAME != 'Windows' }} run: | cd ./dist tar -czvf FontraPak-${{ matrix.NAME }}.tgz fontrapak From dceef42b5dbb3c5bad1e9d6b24f084603c70beac Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Mon, 15 Dec 2025 15:22:49 +0100 Subject: [PATCH 4/8] Install dev deps on all platforms, but we removed pre-commit --- .github/workflows/python-app.yml | 3 +++ requirements-dev.txt | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 376abac..167e784 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -72,6 +72,9 @@ jobs: run: | python macos/ensure_universal_wheels.py pip_log.txt pip install --force build/universal_wheels/*.whl + + - name: Install development dependencies + run: | pip install -r requirements-dev.txt - name: Build app with PyInstaller diff --git a/requirements-dev.txt b/requirements-dev.txt index 7c80b02..02559c4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1 @@ -pre-commit==4.5.0 pytest==9.0.1 From e936439f4e55ad4cf982fa0157c8fbf66c57c9da Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Mon, 15 Dec 2025 15:27:37 +0100 Subject: [PATCH 5/8] Move dev deps to dev deps --- .github/workflows/python-app.yml | 5 +---- requirements-dev.txt | 4 ++++ requirements.txt | 4 ---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 167e784..ab90a0f 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -66,6 +66,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt | tee pip_log.txt + pip install -r requirements-dev.txt - name: Make and install universal wheels if: ${{ matrix.NAME == 'MacOS' }} @@ -73,10 +74,6 @@ jobs: python macos/ensure_universal_wheels.py pip_log.txt pip install --force build/universal_wheels/*.whl - - name: Install development dependencies - run: | - pip install -r requirements-dev.txt - - name: Build app with PyInstaller run: | pyinstaller FontraPak.spec -y diff --git a/requirements-dev.txt b/requirements-dev.txt index 02559c4..66ca0cd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1 +1,5 @@ +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 diff --git a/requirements.txt b/requirements.txt index 7254075..23e8255 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 From 3063f39f31e229494e1c254e564acc9d29b1e669 Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Mon, 15 Dec 2025 15:31:25 +0100 Subject: [PATCH 6/8] Adjust and improve readme --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 667a63a..8f60454 100644 --- a/README.md +++ b/README.md @@ -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 From 6de318444ea6e3ac8912628467a7562c4a1ff6cd Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Mon, 15 Dec 2025 15:46:09 +0100 Subject: [PATCH 7/8] Try to use Compress-Archive on Windows instead of zip --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index ab90a0f..a243e0e 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -113,7 +113,7 @@ jobs: if: ${{ matrix.NAME == 'Windows' }} run: | cd ./dist - zip -q FontraPak-${{ matrix.NAME }}.zip "Fontra Pak.exe" + Compress-Archive -Path "Fontra Pak.exe" -Destination FontraPak-${{ matrix.NAME }}.zip - name: Archive executable with tar if: ${{ matrix.NAME != 'MacOS' && matrix.NAME != 'Windows' }} From 4ad2bdc858032b5d192bae20e378ea9d3e13f28c Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Mon, 15 Dec 2025 16:05:05 +0100 Subject: [PATCH 8/8] Rename to singular --- .github/workflows/python-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index a243e0e..e01bd83 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -10,7 +10,7 @@ on: - "*.*.*" jobs: - build-applications: + build-application: runs-on: ${{ matrix.os }} strategy: @@ -136,7 +136,7 @@ jobs: permissions: contents: write - needs: [build-applications] + needs: [build-application] if: github.ref_type == 'tag' steps: