Skip to content

Commit

Permalink
CI attemp 4/n
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumgizmos committed Jun 25, 2024
1 parent 5a1e5a4 commit f0b2700
Showing 1 changed file with 26 additions and 48 deletions.
74 changes: 26 additions & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,47 @@
name: Build and Publish
name: Build and Upload Python Package

on:
workflow_dispatch:
pull_request:
push:
branches:
- release

jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- name: Checkout out repo and submodules
uses: actions/checkout@v3
with:
submodules: true

- name: Build SDist
run: pipx run build --sdist

- name: Check metadata
run: pipx run twine check dist/*

- name: Upload SDist
uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_and_publish:
name: Build and Publish
runs-on: ${{ matrix.os }}

build_wheels:
name: Build Wheels
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, 3.10, 3.11, 3.12]
os: [macos-latest, windows-latest, ubuntu-latest]
architecture: [x86_64, arm64]
os:
- ubuntu-latest
- macos-latest
- windows-latest
python-version: [3.8, 3.9, 3.10, 3.11, 3.12] # Add more versions as needed
architecture: [x64, arm64] # Add arm64 for Apple Silicon

steps:
- name: Checkout out repo and submodules
uses: actions/checkout@v3
with:
submodules: true
- name: Checkout repository
uses: actions/checkout@v2

- name: Build Wheels
uses: pypa/cibuildwheel@v2.11.1
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
build-options: --arch 64
platform: ${{ matrix.os }}
architecture: ${{ matrix.architecture }}

- name: Upload Wheels
uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel setuptools
upload_pypi:
name: Upload to Test PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Build wheel and sdist
run: python setup.py sdist bdist_wheel

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: artifact
path: dist
path: dist/*

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

0 comments on commit f0b2700

Please sign in to comment.