Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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
84 changes: 84 additions & 0 deletions .github/workflows/CI_PublishTestPyPI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI Python Build & Publish to TestPyPI (Trusted)

on:
push:
tags: ["v*"]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build-wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Linux builds
- os: ubuntu-latest
cibw_archs: "auto"
deployment_target: ""
openblas_path: ""
py_tag: "cp310"
# macOS Intel builds
- os: macos-13 # Intel Mac
cibw_archs: "x86_64"
deployment_target: "13.0"
openblas_path: "/usr/local/opt/openblas"
py_tag: "cp310"
# macOS Apple Silicon builds
- os: macos-latest # Apple Silicon Mac
cibw_archs: "arm64"
deployment_target: "15.0"
openblas_path: "/opt/homebrew/opt/openblas"
py_tag: "cp310"
steps:
- uses: actions/checkout@v4
- name: remove python/.gitignore
shell: bash
run: |
rm -f python/.gitignore
- uses: pypa/cibuildwheel@v3.1.4
env:
CIBW_DEPENDENCY_VERSIONS: "latest"
CIBW_BUILD_VERBOSITY: 1
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28"
CIBW_BUILD: "${{ matrix.py_tag }}-*"
CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=${{ matrix.deployment_target || '11.0' }} SPARSEIR_USE_BLAS=1"
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_SKIP: "*-manylinux_i686 *-musllinux_i686"
# Install OpenBLAS using micromamba (conda-forge) - separate for manylinux and musllinux
CIBW_BEFORE_ALL_MANYLINUX: "curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba && ./bin/micromamba create -y -p /opt/openblas && ./bin/micromamba install -y -c conda-forge openblas -p /opt/openblas --no-deps"
CIBW_BEFORE_ALL_MUSLLINUX: "apk add --no-cache bzip2 && curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba && ./bin/micromamba create -y -p /opt/openblas && ./bin/micromamba install -y -c conda-forge openblas -p /opt/openblas --no-deps"
CIBW_BEFORE_ALL_MACOS: "brew install openblas"
# Set environment variables to help CMake find OpenBLAS
CIBW_ENVIRONMENT_MANYLINUX: "SPARSEIR_USE_BLAS=1"
CIBW_ENVIRONMENT_MUSLLINUX: "SPARSEIR_USE_BLAS=1"
with:
package-dir: ./python
output-dir: dist
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}-${{ matrix.py_tag }}
path: dist/*

publish-testpypi:
needs: build-wheels
runs-on: ubuntu-latest
environment:
name: testpypi
permissions:
id-token: write # ← Trusted Publishing に必須
contents: read
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Publish to TestPyPI (Trusted)
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
repository-url: https://test.pypi.org/legacy/
verbose: true
skip-existing: true
attestations: false # Disable attestations due to Sigstore service issues
10 changes: 4 additions & 6 deletions .github/workflows/PublishPyPI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Python Build & Publish (Trusted)
on:
push:
tags: ["v*"] # 例: v0.1.0 を push で発火
#pull_request: # for debugging
# branches: [main] # for debugging
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -106,11 +104,11 @@ jobs:
name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}-${{ matrix.py_tag }}
path: dist/*

publish-testpypi:
publish-pypi:
needs: build-wheels
runs-on: ubuntu-latest
environment:
name: testpypi
name: pypi
permissions:
id-token: write # ← Trusted Publishing に必須
contents: read
Expand All @@ -119,11 +117,11 @@ jobs:
with:
path: dist
merge-multiple: true
- name: Publish to TestPyPI (Trusted)
- name: Publish to PyPI (Trusted)
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
repository-url: https://test.pypi.org/legacy/
repository-url: https://pypi.org/legacy/
verbose: true
skip-existing: true
attestations: false # Disable attestations due to Sigstore service issues
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pylibsparseir"
version = "0.1.2"
version = "0.1.0"
description = "Python bindings for the libsparseir library, providing efficient sparse intermediate representation for many-body physics calculations"
readme = "README.md"
requires-python = ">=3.10"
Expand Down
Loading