Skip to content

Fix yaml syntax error of github action Build Wheel #8

Fix yaml syntax error of github action Build Wheel

Fix yaml syntax error of github action Build Wheel #8

Workflow file for this run

#A* -------------------------------------------------------------------
#B* This file contains source code for running a GitHub automation
#-* related to the build process of the PyMOL computer program
#C* Copyright 2025 by Martin Urban.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or remove this copyright notice.
#F* -------------------------------------------------------------------
#G* Please see the accompanying LICENSE file for further information.
#H* -------------------------------------------------------------------
#I* Additional authors of this source file include:
#-*
#-*
#-*
#Z* -------------------------------------------------------------------
#name: Build Wheel
#
#on: [push]
#
#jobs:
# build:
#
# runs-on: macos-latest
# strategy:
# matrix:
# python-version: ["3.10", "3.11", "3.12"]
#
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
# # You can test your matrix by printing the current Python version
# - name: Display Python version
# run: python -c "import sys; print(sys.version)"
#
# - name: Install dependencies
# run: |
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# brew install cmake
# python -m venv .venv
# ./.venv/bin/pip install wheel setuptools
# ./.venv/bin/pip install -r requirements.txt
# ./automator.sh setup dev-env
#
# - name: Build wheel
# run: |
# ./automator.sh build so
# ./automator.sh build wheel
#
# - name: Upload artifact
# uses: actions/upload-artifact@v4
# with:
# name: wheel-${{ matrix.python-version }}
# path: dist/*.whl
name: Build Wheel
on: [push]
env:
VCPKG_ROOT: ${{ github.workspace }}/vendor/vcpkg # Match your project structure
VCPKG_TRIPLET: x64-osx # Use arm64-osx for Apple Silicon
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
arch: [x86_64, arm64]
python-version: ["3.11", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Initialize vcpkg
run: |
git clone https://github.com/Microsoft/vcpkg.git vendor/vcpkg
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Create virtual environment
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install wheel # Add other build deps if needed
python -m pip install -r requirements.txt
- name: Cache vcpkg
uses: actions/cache@v3
with:
path: |
${{ env.VCPKG_ROOT }}/downloads
${{ env.VCPKG_ROOT }}/packages
${{ env.VCPKG_ROOT }}/installed
key: ${{ runner.os }}-vcpkg-${{ matrix.arch }}-${{ hashFiles('vcpkg.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-${{ matrix.arch }}-
- name: Bootstrap vcpkg
run: ${{ env.VCPKG_ROOT }}/bootstrap-vcpkg.sh -disableMetrics
- name: Install vcpkg dependencies
run: |
${{ env.VCPKG_ROOT }}/vcpkg install
- name: Build extension
run: |
source .venv/bin/activate
python automations/my_automator.py build so
python automations/my_automator.py build wheel
# - name: Create universal binary
# if: matrix.arch == 'x86_64' # Run once after both arch builds
# run: |
# lipo -create \
# -output dist/_cmd_universal.so \
# build/lib*/_cmd*.so
# rm build/lib*/_cmd*.so # Clean individual arch builds
# mv dist/_cmd_universal.so build/lib/
#
# - name: Package wheel
# if: matrix.arch == 'x86_64'
# run: |
# source .venv/bin/activate
# python setup.py bdist_wheel
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: pymol-wheel
path: dist/*.whl
# TRIPLET=$([ "${{ matrix.arch }}" = "arm64" ] && echo "arm64-osx" || echo "x64-osx")