Skip to content

Commit 8c51a1b

Browse files
committed
Update building
1 parent abc92ce commit 8c51a1b

2 files changed

Lines changed: 44 additions & 34 deletions

File tree

.github/workflows/release_with_cache.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: Build aarch64 macOS Wheels with caching
22

3-
on:
4-
release:
5-
types: [created]
6-
push:
7-
branches: [ "main" ]
8-
pull_request:
9-
branches: [ "main" ]
10-
workflow_dispatch:
3+
# on:
4+
# release:
5+
# types: [created]
6+
# push:
7+
# branches: [ "main" ]
8+
# pull_request:
9+
# branches: [ "main" ]
10+
# workflow_dispatch:
1111

1212
env:
1313
# Define VCPKG_ROOT with the correct path syntax for all runners.

.github/workflows/simple_test.yaml

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,56 @@
1-
# A simple workflow to build a Python sdist and wheel on Windows.
2-
# This file should be placed in the .github/workflows/ directory of your repository.
3-
4-
name: Build Python Package
1+
name: Build and Publish macOS Wheels
52

63
on:
7-
# Triggers the workflow on push or pull request events for the "main" branch
4+
release:
5+
types: [created]
86
push:
97
branches: [ "main" ]
108
pull_request:
119
branches: [ "main" ]
1210

13-
# Allows you to run this workflow manually from the Actions tab
1411
workflow_dispatch:
1512

1613
jobs:
17-
build:
18-
# The type of runner that the job will run on
14+
build_wheels:
15+
name: Build wheels for macOS (arm64)
1916
runs-on: macos-latest
2017

2118
steps:
22-
# Step 1: Check out your repository code so the workflow can access it
2319
- name: Checkout code
2420
uses: actions/checkout@v4
25-
26-
# Step 2: Set up a Python environment
27-
- name: Set up Python 3.11
28-
uses: actions/setup-python@v5
2921
with:
30-
python-version: '3.11'
31-
architecture: 'arm64'
32-
33-
- uses: tecolicom/actions-install-and-cache@v1
22+
# Required for cibuildwheel to get a clean version number.
23+
fetch-depth: 0
24+
25+
- name: Build wheels
26+
uses: pypa/cibuildwheel@v2.19.2
27+
env:
28+
# Python versions to build for.
29+
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
30+
CIBW_ARCHS_MACOS: arm64
31+
CIBW_BEFORE_BUILD: "brew install sdl2 opencv pybind11"
32+
33+
- name: Store wheels as artifact
34+
uses: actions/upload-artifact@v4
3435
with:
35-
run: brew install sdl2 opencv pybind11
36-
path: /usr/local
37-
verbose: true
36+
name: macos-wheels
37+
path: ./wheelhouse/*.whl
3838

39-
# Step 6: Install the 'build' package itself, which is required to run the build command
40-
- name: Install build tool
41-
run: python -m pip install --upgrade build
39+
publish_to_pypi:
40+
name: Publish wheels to PyPI
41+
needs: build_wheels
42+
runs-on: ubuntu-latest
43+
# if: github.event_name == 'release' && github.event.action == 'created'
4244

43-
# Step 7: Run the build command as requested
44-
- name: Build sdist and wheel
45-
run: python -m build -v -sw
45+
steps:
46+
- name: Download wheels from artifact
47+
uses: actions/download-artifact@v4
48+
with:
49+
name: macos-wheels
50+
path: dist
51+
52+
- name: Publish package to PyPI
53+
uses: pypa/gh-action-pypi-publish@release/v1
54+
with:
55+
password: ${{ secrets.PYPI_API_TOKEN }}
4656

0 commit comments

Comments
 (0)