Skip to content

Commit

Permalink
Merge pull request #60 from ocni-dtu/chrk/multi_python_compile_targets
Browse files Browse the repository at this point in the history
fix: adding more compile targets for Python
  • Loading branch information
ocni-dtu committed Jul 6, 2024
2 parents 6bcada3 + 371a56d commit 5216847
Showing 1 changed file with 45 additions and 8 deletions.
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

0 comments on commit 5216847

Please sign in to comment.