Merge pull request #86 from cloudflare/github-actions-osx #5
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: MacOSX build/release workflow | |
on: | |
push: | |
pull_request: | |
release: | |
types: [published] | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build wheel on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-11, macos-12, macos-13] | |
python-version: ['3.11'] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip setuptools wheel pytest | |
brew update | |
brew install boost | |
# The option --ignore-dependencies is a workaround required to | |
# avoid boost-python3 installing python@3.11. This option will | |
# be removed when Python default Mac OSX version will be v3.11 | |
brew install boost-python3 --ignore-dependencies | |
env: | |
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 | |
- name: Build wheel | |
run: | | |
python setup.py v8 | |
sudo python setup.py sdist bdist_wheel -d stpyv8-${{ matrix.os }}-${{ matrix.python-version }} | |
sudo python setup.py install | |
sudo cp v8/out.gn/x64.release.sample/icudtl.dat stpyv8-${{ matrix.os }}-${{ matrix.python-version }}/icudtl.dat | |
- name: Test wheel | |
run: | | |
pytest -v | |
- name: Create wheel zip | |
uses: vimtor/action-zip@v1.1 | |
with: | |
files: stpyv8-${{ matrix.os }}-${{ matrix.python-version }}/ | |
recursive: false | |
dest: stpyv8-${{ matrix.os }}-python-${{ matrix.python-version }}.zip | |
- name: Upload wheel zip | |
uses: actions/upload-artifact@v3 | |
if: ${{ github.event_name != 'release' }} | |
with: | |
name: wheels | |
path: stpyv8-${{ matrix.os }}-python-${{ matrix.python-version }}.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
files: 'stpyv8-${{ matrix.os }}-python-${{ matrix.python-version }}.zip' | |
token: ${{ secrets.GITHUB_TOKEN }} |