Skip to content

Support for Python version 3.12 and 3.13 #366

Support for Python version 3.12 and 3.13

Support for Python version 3.12 and 3.13 #366

name: Build macOS app
on:
push:
pull_request:
release:
types:
- published
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12]
architecture: [x64]
python-version: ['3.10']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
architecture: ${{ matrix.architecture }}
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip pyinstaller setuptools wheel cython cffi -r requirements.txt
- name: Build Cython ext
run: |
python setup.py build_ext --inplace
- name: Make pyinstaller spec
run: |
pyi-makespec --hidden-import="pkg_resources.py2_warn" -F --add-data images/\*:images --add-data \*.png:. --add-data \*.ico:. --name Pronterface -w -i P-face.icns pronterface.py
# Edit spec file
export git_hash=$(git rev-parse --short "$GITHUB_SHA")
sed -i '' '$ s/.$//' Pronterface.spec
cat >> Pronterface.spec <<EOL
info_plist={
'CFBundleShortVersionString': '$git_hash',
'NSPrincipalClass': 'NSApplication',
'NSAppleScriptEnabled': False,
'NSAppSleepDisabled': True,
},
)
EOL
- name: Make pyinstaller build
run: |
pyinstaller --clean Pronterface.spec -y
# Zip app manually to avoid losing execute permissions for binary file in app
cd dist
zip -r -X Pronterface-app.zip Pronterface.app
- name: Configuration for releases
if: ${{ github.event_name == 'release' }}
run: |
echo "EXE_NAME=${{ github.ref_name }}_macos_${{ matrix.architecture }}" >> $GITHUB_ENV
- name: Configuration for pushes
if: ${{ github.event_name == 'push' }}
run: |
echo "EXE_NAME=printrun-nightly_${{ matrix.os }}_${{ matrix.architecture }}_py${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Configuration for pull requests
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "EXE_NAME=printrun-test_${{ matrix.os }}_${{ matrix.architecture }}_py${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Upload artifacts for inspection
uses: actions/upload-artifact@v4
with:
name: ${{ env.EXE_NAME }}
path: dist/Pronterface-app.zip
upload_release_assets:
needs: [build]
if: github.event_name == 'release' && github.event.action == 'published'
uses: kliment/Printrun/.github/workflows/upload-assets.yml@master