65 lines
1.5 KiB
YAML
65 lines
1.5 KiB
YAML
name: Publish
|
|
|
|
on: [push, pull_request, workflow_call]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
pytest:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
python-version: [ "3.10", "3.12" ]
|
|
os: [ ubuntu-latest, windows-latest, macOS-latest ]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install
|
|
run: pip install .[test]
|
|
- name: Test with pytest
|
|
run: pytest
|
|
|
|
sdist:
|
|
needs: [ pytest ]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
- name: Build sdist
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.12"
|
|
- name: Install build
|
|
run: pip install build
|
|
- name: Build a binary wheel and a source tarball
|
|
run: python -m build
|
|
- name: Upload sdist
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: sdist
|
|
path: dist
|
|
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
needs: [ sdist ]
|
|
environment:
|
|
name: pypi
|
|
url: https://pypi.org/p/parfor
|
|
permissions:
|
|
id-token: write
|
|
steps:
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v7
|
|
with:
|
|
name: sdist
|
|
path: dist
|
|
- name: Publish to PyPI
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|