Skip to content

Packaging QuadDType #33

Packaging QuadDType

Packaging QuadDType #33

name: Build quaddtype wheels and release
on:
push:
branches:
- testing-pkg
tags:
- "v*"
pull_request:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-13, macos-14]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install cibuildwheel
run: pip install cibuildwheel==2.20.0
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD_VERBOSITY: "1"
CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }}
working-directory: ./quaddtype
- uses: actions/upload-artifact@v2
with:
path: ./quaddtype/wheelhouse/*.whl
name: wheels-${{ matrix.os }}
publish_to_testpypi:
name: Publish to TestPyPI
needs: build_wheels
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
with:
path: dist
- name: Publish to TestPyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
packages-dir: dist/*
create_release:
name: Create Release
needs: build_wheels
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./artifacts/**/*.whl
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}