CI: Improves Python build and upload

pull/717/head
Tpt 12 months ago committed by Thomas Tanon
parent 391e8d7662
commit f2a2bd5b5d
  1. 58
      .github/workflows/artifacts.yml
  2. 2
      .github/workflows/manylinux_build.sh
  3. 2
      .github/workflows/musllinux_build.sh

@ -111,6 +111,11 @@ jobs:
python_sdist: python_sdist:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pyoxigraph
permissions:
id-token: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
@ -132,14 +137,18 @@ jobs:
with: with:
name: pyoxigraph_source name: pyoxigraph_source
path: target/wheels/*.tar.gz path: target/wheels/*.tar.gz
- run: pip install twine && twine upload target/wheels/* - uses: pypa/gh-action-pypi-publish@release/v1
env: with:
TWINE_USERNAME: __token__ packages-dir: target/wheels
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
if: github.event_name == 'release' if: github.event_name == 'release'
wheel_linux: wheel_linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pyoxigraph
permissions:
id-token: write
strategy: strategy:
matrix: matrix:
architecture: [ "x86_64", "aarch64" ] architecture: [ "x86_64", "aarch64" ]
@ -158,17 +167,20 @@ jobs:
if: github.event_name == 'release' || matrix.architecture == 'x86_64' if: github.event_name == 'release' || matrix.architecture == 'x86_64'
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
name: pyoxigraph_wheel_x86_64_linux_gnu name: pyoxigraph_wheel_linux_gnu
path: target/wheels/*.whl path: target/wheels/*.whl
- uses: pypa/gh-action-pypi-publish@release/v1 - uses: pypa/gh-action-pypi-publish@release/v1
with: with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
packages-dir: target/wheels packages-dir: target/wheels
if: github.event_name == 'release' if: github.event_name == 'release'
wheel_linux_musl: wheel_linux_musl:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pyoxigraph
permissions:
id-token: write
strategy: strategy:
matrix: matrix:
architecture: [ "x86_64", "aarch64" ] architecture: [ "x86_64", "aarch64" ]
@ -187,17 +199,20 @@ jobs:
if: github.event_name == 'release' || matrix.architecture == 'x86_64' if: github.event_name == 'release' || matrix.architecture == 'x86_64'
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
name: pyoxigraph_wheel_x86_64_linux_musl name: pyoxigraph_wheel_linux_musl
path: target/wheels/*.whl path: target/wheels/*.whl
- uses: pypa/gh-action-pypi-publish@release/v1 - uses: pypa/gh-action-pypi-publish@release/v1
with: with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
packages-dir: target/wheels packages-dir: target/wheels
if: github.event_name == 'release' if: github.event_name == 'release'
wheel_mac: wheel_mac:
runs-on: macos-latest runs-on: macos-latest
environment:
name: pypi
url: https://pypi.org/p/pyoxigraph
permissions:
id-token: write
env: env:
DEVELOPER_DIR: '/Applications/Xcode.app/Contents/Developer' DEVELOPER_DIR: '/Applications/Xcode.app/Contents/Developer'
SDKROOT: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' SDKROOT: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'
@ -231,16 +246,20 @@ jobs:
if: github.event_name == 'release' if: github.event_name == 'release'
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
name: pyoxigraph_wheel_universal2_mac name: pyoxigraph_wheel_mac
path: target/wheels/*.whl path: target/wheels/*.whl
- run: pip install twine && twine upload target/wheels/* - uses: pypa/gh-action-pypi-publish@release/v1
env: with:
TWINE_USERNAME: __token__ packages-dir: target/wheels
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
if: github.event_name == 'release' if: github.event_name == 'release'
wheel_windows: wheel_windows:
runs-on: windows-latest runs-on: windows-latest
environment:
name: pypi
url: https://pypi.org/p/pyoxigraph
permissions:
id-token: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
@ -262,12 +281,11 @@ jobs:
- run: maturin build --release -m python/Cargo.toml --features abi3 - run: maturin build --release -m python/Cargo.toml --features abi3
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
name: pyoxigraph_wheel_x86_64_windows name: pyoxigraph_wheel_windows
path: target/wheels/*.whl path: target/wheels/*.whl
- run: pip install twine && twine upload target/wheels/* - uses: pypa/gh-action-pypi-publish@release/v1
env: with:
TWINE_USERNAME: __token__ packages-dir: target/wheels
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
if: github.event_name == 'release' if: github.event_name == 'release'
npm_tarball: npm_tarball:

@ -11,7 +11,7 @@ cd python
python3.12 -m venv venv python3.12 -m venv venv
source venv/bin/activate source venv/bin/activate
pip install -r requirements.dev.txt pip install -r requirements.dev.txt
maturin develop --release maturin develop --release --no-default-features --features rustls
python generate_stubs.py pyoxigraph pyoxigraph.pyi --ruff python generate_stubs.py pyoxigraph pyoxigraph.pyi --ruff
maturin build --release --no-default-features --features abi3 --features rustls --compatibility manylinux2014 maturin build --release --no-default-features --features abi3 --features rustls --compatibility manylinux2014
if [ %for_each_version% ]; then if [ %for_each_version% ]; then

@ -9,7 +9,7 @@ cd python
python3.12 -m venv venv python3.12 -m venv venv
source venv/bin/activate source venv/bin/activate
pip install -r requirements.dev.txt pip install -r requirements.dev.txt
maturin develop --release maturin develop --release --no-default-features --features rustls
python generate_stubs.py pyoxigraph pyoxigraph.pyi --ruff python generate_stubs.py pyoxigraph pyoxigraph.pyi --ruff
maturin build --release --no-default-features --features abi3 --features rustls --compatibility musllinux_1_2 maturin build --release --no-default-features --features abi3 --features rustls --compatibility musllinux_1_2
if [ %for_each_version% ]; then if [ %for_each_version% ]; then

Loading…
Cancel
Save