This repository has been archived by the owner on Jan 18, 2025. It is now read-only.
Update build.yml #75
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: dist | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
release: | |
types: | |
- published | |
jobs: | |
build_sdist: | |
name: Build SDist | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Update GCC | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y g++-11 | |
- name: Build SDist | |
run: pipx run build --sdist | |
- name: Check metadata | |
run: pipx run twine check dist/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dist/*.tar.gz | |
build_wheels: | |
name: Wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-13, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- uses: maxim-lobanov/setup-xcode@v1 | |
if: matrix.os == 'macos-13' | |
with: | |
xcode-version: 'latest' | |
- name: Update GCC | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y g++-11 | |
- uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS_MACOS: auto universal2 | |
MACOSX_DEPLOYMENT_TARGET: "10.15" | |
- name: Verify clean directory | |
run: git diff --exit-code | |
shell: bash | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: wheelhouse/*.whl | |
upload_test: | |
name: Upload test | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository-url: https://test.pypi.org/legacy/ | |
verbose: true | |
skip_existing: true | |
upload_official: | |
name: Upload official | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
if: (github.event_name == 'release' && github.event.action == 'published') || github.event_name == 'workflow_dispatch' | |
steps: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
verbose: true |