Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adding more compile targets for Python #60

Merged
merged 1 commit into from
Jul 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 45 additions & 8 deletions .github/workflows/publish_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,25 @@ on:
default: ""

jobs:
publishPython:
buildPython:
if: ${{ inputs.release_version != ''}}
runs-on: ubuntu-latest
runs-on: ${{ matrix.os.runner }}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
os:
- name: linux-amd64
runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
- name: win-amd64
runner: windows-latest
target: x86_64-pc-windows-msvc
- name: macos-amd64
runner: macos-latest
target: x86_64-apple-darwin
- name: macos-arm64
runner: macos-latest
target: aarch64-apple-darwin
steps:
- uses: actions/checkout@v4

Expand All @@ -30,19 +46,40 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install Dependencies
run: |
pip install maturin virtualenv
virtualenv venv
source venv/bin/activate
maturin develop --target x86_64-unknown-linux-gnu
maturin develop --target ${{ matrix.os.target }}

- name: Publish to PyPI
- name: Build Wheel
run: |
source venv/bin/activate
maturin publish --out dist
env:
MATURIN_PYPI_TOKEN: ${{ secrets.pypi_token }}
maturin build --target ${{ matrix.os.target }} --out dist

- name: Upload Wheel
uses: actions/upload-artifact@v4
with:
name: lcax-${{ matrix.os.name }}-${{ matrix.python-version }}
path: dist

publishPython:
if: ${{ inputs.release_version != ''}}
runs-on: ubuntu-latest
needs: buildPython
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist

- name: Check Download
run: ls -lah dist

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading