Skip to content

Publish to PyPI

Publish to PyPI #14

Workflow file for this run

name: Publish to PyPI
on:
push:
tags:
- 'v*'
workflow_dispatch: # Allows you to run this manually for testing
jobs:
test:
name: Run Automated Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install "numpy<2" pytest matplotlib pandas scipy
pip install -e .
- name: Run Pytest
run: pytest tests
build-n-publish:
name: Build and publish to PyPI
needs: test
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/XdetectionCore
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
- name: Install build tool
run: pip install build
- name: Build binary
run: |
rm -rf dist/ # Force delete any existing dist folder
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1