Skip to content

CD

CD #22

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: CD
on:
workflow_dispatch:
release:
types:
- published
jobs:
build_package:
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ] #, "macos-latest", "windows-latest" ] # comment out for testing deploy
python-version: [ "3.9" ] #, "3.9", "3.10", "3.11", "3.12" ] # comment out for testing deploy
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build internal items
run: cd src; make
- name: Setup pandoc for docs build
uses: r-lib/actions/setup-pandoc@v2
- name: Build docs
run: |
pip install ply
pip install numpy
pip install .
pip install pdoc
cd docs; make
- name: Build Package
uses: pypa/[email protected]
- name: Upload wheels to artifact
uses: actions/upload-artifact@v4
with:
name: cibw-wheel-${{ matrix.os }}-${{ matrix.python-version }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
pypi-publish:
name: Upload release to PyPI
needs: [ build_package, build_sdist ]
runs-on: ubuntu-latest
#if: startsWith(github.ref, 'refs/tags/') #only tagged releases
environment:
name: testpypi
url: https://test.pypi.org/p/pycifrw/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-wheel-*
path: dist
merge-multiple: true
- name: check the dist folder
run: ls -R dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/