Adds logo.png for Ubuntu build #12
Workflow file for this run
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 Packages | |
on: | |
push: | |
tags: | |
- "v*.*" # Triggers on tags like v1.0.0, v0.1.0, etc. | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [windows-latest, macos-13, macos-latest, ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set required env vars | |
env: | |
ARTIFACT_PATH: ${{ runner.os == 'macOS' && 'OSXBuild/*' || (runner.os == 'Linux' && 'LinuxBuild/*' || 'WindowsBuild/*') }} | |
run: | | |
OS=$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]') | |
ARCH=$(echo "$RUNNER_ARCH" | tr '[:upper:]' '[:lower:]') | |
VERSION="${GITHUB_REF_NAME#v}" | |
ARTIFACT_NAME="bdrc_ocr_${OS}_${ARCH}_${VERSION}" | |
{ | |
echo "VERSION=$VERSION" | |
echo "ARTIFACT_NAME=$ARTIFACT_NAME" | |
echo "ARTIFACT_PATH=$ARTIFACT_PATH" | |
} >>"$GITHUB_ENV" | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
- name: Cache Nuitka | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/.nuitka_cache | |
key: ${{ runner.os }}-nuitka | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install Linux Dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libxcb-xinerama0 libxcb-cursor0 libxkbcommon-x11-0 | |
- name: Install dependencies | |
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) | |
if: ${{ runner.os == 'macOS' }} | |
env: | |
APPLE_DEVELOPER_ID: ${{ secrets.APPLE_DEVELOPER_ID }} | |
APPLE_JF_ID: ${{ secrets.APPLE_JF_ID }} | |
APPLE_JF_PASSWORD: ${{ secrets.APPLE_JF_PASSWORD }} | |
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='${{ env.VERSION }}' \ | |
--product-version='${{ env.VERSION }}' \ | |
--macos-app-name="BDRC Tibetan OCR App" \ | |
--macos-signed-app-name="io.bdrc.ocrapp" \ | |
--macos-create-app-bundle \ | |
--macos-app-icon=logo.icns \ | |
--macos-sign-identity="${APPLE_DEVELOPER_ID}" \ | |
--macos-sign-notarization \ | |
--include-data-dir=./Assets=Assets \ | |
--include-data-dir=./Models=Models \ | |
main.py | |
- name: Build with Nuitka (Linux) | |
if: ${{ runner.os == 'Linux' }} | |
run: | | |
python -m nuitka --standalone \ | |
--output-dir=LinuxBuild \ | |
--plugin-enable=pyside6 \ | |
--verbose \ | |
--company-name="Buddhist Digital Resource Center" \ | |
--product-name="Tibetan OCR App" \ | |
--file-version='${{ env.VERSION }}' \ | |
--product-version='${{ env.VERSION }}' \ | |
--linux-icon=logo.png \ | |
--include-data-dir=./Assets=Assets \ | |
--include-data-dir=./Models=Models \ | |
main.py | |
- name: Build with Nuitka (Windows) | |
if: ${{ runner.os == 'Windows' }} | |
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='${{ env.VERSION }}' \ | |
--product-version='${{ env.VERSION }}' \ | |
--include-data-dir=./Assets=Assets \ | |
--include-data-dir=./Models=Models \ | |
main.py | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACT_PATH }} |