cannot use Ubuntu in manywheels. Make it trigger manually since we ca… #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test and Publish to PyPI | |
on: | |
push: | |
branches: [main, master] | |
pull_request: | |
branches: [main, master] | |
release: | |
types: [published] | |
workflow_dispatch: # Allow manual triggering | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and run tests in Docker | |
run: | | |
docker build -t pyindi-client . | |
docker run --rm pyindi-client | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
needs: test | |
environment: pypi | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" | |
CIBW_ARCHS_LINUX: "x86_64 aarch64" | |
CIBW_BEFORE_ALL_LINUX: | | |
set -e | |
yum install -y epel-release || { echo "Failed to add EPEL"; exit 1; } | |
yum install -y swig cfitsio-devel libnova-devel cmake gcc-c++ make || { echo "Failed to install dependencies"; exit 1; } | |
# Build INDI from source | |
curl -L https://github.com/indilib/indi/archive/v2.1.1.tar.gz | tar xz | |
cd indi-2.1.1 | |
mkdir build && cd build | |
cmake -DCMAKE_INSTALL_PREFIX=/usr .. | |
make -j4 | |
make install | |
cd ../.. | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
publish: | |
needs: build_wheels | |
runs-on: ubuntu-latest | |
environment: pypi | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install build dependencies | |
run: python -m pip install build | |
- name: Build source distribution | |
run: python -m build --sdist | |
- name: Download wheels | |
uses: actions/download-artifact@v3 | |
with: | |
path: dist | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |