Skip to content

Commit

Permalink
[Chore] Update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Jan 30, 2025
1 parent 1039192 commit 4a4bd57
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 4 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build-publish-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Mac builds

on: [push, workflow_dispatch]

jobs:
build_and_publish:
strategy:
matrix:
# macos-13 is an intel runner, macos-14+ is apple silicon
os: [macos-13, macos-14, macos-15]

runs-on: ${{ matrix.os }}

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Build Wheels
uses: pypa/[email protected]
env:
CXXFLAGS: -Wno-enum-constexpr-conversion
CFLAGS: -Wno-enum-constexpr-conversion
CIBW_BUILD: cp311-* cp312-* cp313-*
CIBW_PROJECT_REQUIRES_PYTHON: '>=3.10'
MACOSX_DEPLOYMENT_TARGET: 15.2

- uses: actions/upload-artifact@v4
with:
name: pygeoda-${{ matrix.os }}
path: wheelhouse/

- name: Publish to Pypi
if: startsWith(github.ref, 'refs/tags/v')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade --upgrade-strategy eager twine setuptools
python3 -m twine upload wheelhouse/*.whl
- name: Publish source to Pypi
if: startsWith(github.ref, 'refs/tags/v')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
source venv/bin/activate
python3 setup.py sdist
python3 -m twine upload dist/*.tar.gz
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ubuntu and Mac builds
name: Ubuntu builds

on: [push, workflow_dispatch]

Expand All @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
# macos-13 is an intel runner, macos-14+ is apple silicon
os: [ubuntu-latest, macos-13, macos-14, macos-15]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

Expand All @@ -20,7 +20,6 @@ jobs:
submodules: recursive

- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y build-essential libc6-dev
Expand All @@ -32,7 +31,6 @@ jobs:
CFLAGS: -Wno-enum-constexpr-conversion
CIBW_BUILD: cp311-* cp312-* cp313-*
CIBW_PROJECT_REQUIRES_PYTHON: '>=3.10'
MACOSX_DEPLOYMENT_TARGET: 15.2

- uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit 4a4bd57

Please sign in to comment.