Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Update build.yml

Update build.yml #51

Workflow file for this run

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@v3
with:
fetch-depth: 0
submodules: recursive
- name: Build SDist
run: pipx run build --sdist
- name: Check metadata
run: pipx run twine check dist/*
- uses: actions/upload-artifact@v3
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@v3
with:
fetch-depth: 0
submodules: recursive
- uses: maxim-lobanov/setup-xcode@v1
if: matrix.os == 'macos-13'
with:
xcode-version: '14.3'
- 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@v3
with:
path: wheelhouse/*.whl
upload_test:
name: Upload test
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
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@v4
with:
python-version: "3.x"
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true