Skip to content

Fixes building error for Intel Macs #9

Fixes building error for Intel Macs

Fixes building error for Intel Macs #9

Workflow file for this run

name: Build Packages
on:
push:
tags:
- 'v*.*' # Triggers on tags like v1.0.0, v0.1.0, etc.
jobs:
build:
strategy:
matrix:
os: [windows-latest, macos-latest]
python-version: ['3.10']
include:
- os: macos-latest
target: macos
- os: windows-latest
target: windows
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Get version from tag
id: get_version
shell: bash
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "release_version=${VERSION}" >> "$GITHUB_ENV"
echo "release_version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Debug Windows Path
if: runner.os == 'Windows'
shell: pwsh
run: |
Write-Output "GITHUB_REF: $env:GITHUB_REF"
Write-Output "release_version: $env:release_version"
- name: ccache
uses: hendrikmuhs/[email protected]
- name: Cache Nuitka
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.nuitka_cache
key: ${{ runner.os }}-nuitka
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
timeout-minutes: 5
run: |
python -m pip install --upgrade pip
pip install nuitka
pip install pyside6
pip install -r requirements.txt
pyside6-rcc resources.qrc -o resources.py
- name: Build with Nuitka (MacOS)
timeout-minutes: 60
if: matrix.os == 'macos-latest'
env:
APPLE_DEVELOPER_ID: ${{ secrets.APPLE_DEVELOPER_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
python -m nuitka --standalone \
--output-dir=OSXBuild \
--plugin-enable=pyside6 \
--verbose \
--company-name="Buddhist Digital Resource Center" \
--product-name="Tibetan OCR App" \
--file-version=${{ steps.get_version.outputs.release_version }} \
--product-version=${{ steps.get_version.outputs.release_version }} \
--macos-app-name="BDRC Tibetan OCR App" \
--macos-signed-app-name="io.bdrc.ocrapp" \
--macos-create-app-bundle \
--macos-app-icon=logo.icns \
--include-data-dir=./Assets=Assets \
--include-data-dir=./Models=Models \
main.py
- name: Build with Nuitka (Windows)
timeout-minutes: 60
if: matrix.os == 'windows-latest'
run: |
python -m nuitka --standalone `
--windows-console-mode=disable `
--assume-yes-for-downloads `
--output-dir=WindowsBuild `
--plugin-enable=pyside6 `
--windows-icon-from-ico=logo.ico `
--company-name="Buddhist Digital Resource Center" `
--product-name="Tibetan OCR App" `
--file-version=${{ steps.get_version.outputs.release_version }} `
--product-version=${{ steps.get_version.outputs.release_version }} `
--include-data-dir=./Assets=Assets `
--include-data-dir=./Models=Models `
main.py
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}-build-${{ steps.get_version.outputs.release_version }}
path: |
${{ matrix.os == 'macos-latest' && 'OSXBuild/*' || 'WindowsBuild/*' }}