Skip to content

Commit

Permalink
Build and release on macos (#124)
Browse files Browse the repository at this point in the history
* Test on macos and latest os

* Test stable on all 1.70 on ubuntu only

* Fix for MSRV test

* Test macos sdist build

* Fix multiple artifact merge

* Remove publish on release only

* Downgrade action in v3

* Restore upload on published release
  • Loading branch information
relf authored Jan 6, 2024
1 parent e3be206 commit 4ec3f73
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 44 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
os:
- ubuntu-latest
- windows-latest
- macos-latest

steps:
- uses: actions/checkout@v4
Expand Down
78 changes: 39 additions & 39 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
Expand All @@ -55,55 +55,55 @@ jobs:
args: --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

# macos:
# runs-on: macos-latest
# strategy:
# matrix:
# target: [x86_64, aarch64]
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: '3.10'
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.target }}
# args: --release --out dist --find-interpreter
# sccache: 'true'
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels
# path: dist
macos:
runs-on: macos-latest
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

# sdist:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Build sdist
# uses: PyO3/maturin-action@v1
# with:
# command: build
# args: --sdist --out dist --release
# - name: Upload sdist
# uses: actions/upload-artifact@v4
# with:
# name: wheels
# path: dist
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: build
args: --sdist --out dist --release
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
needs: [linux, windows]
needs: [sdist, linux, windows, macos]
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Publish to PyPI
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ jobs:
fail-fast: false
matrix:
toolchain:
- 1.70.0
- stable
os:
- ubuntu-20.04
- windows-2019
- ubuntu-latest
- windows-latest
- macos-latest
include:
- toolchain: 1.70.0 # test MSRV
os: ubuntu-latest

steps:
- name: Checkout sources
Expand Down Expand Up @@ -53,7 +56,7 @@ jobs:
toolchain:
- stable
os:
- ubuntu-20.04
- ubuntu-latest

steps:
- name: Checkout sources
Expand Down Expand Up @@ -84,7 +87,7 @@ jobs:
toolchain:
- stable
os:
- ubuntu-20.04
- ubuntu-latest

steps:
- name: Checkout sources
Expand Down

0 comments on commit 4ec3f73

Please sign in to comment.