check pypi version #1
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: Publish PyPI package | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
publish-pypi: | |
name: upload release to PyPI | |
runs-on: ubuntu-latest | |
# Specifying a GitHub environment is optional, but strongly encouraged | |
environment: pypi | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: "3.10" | |
mamba-version: "*" | |
channels: conda-forge,defaults | |
channel-priority: true | |
activate-environment: sparc-api-test | |
- name: Install dependencies | |
run: | | |
pip install -U build | |
- name: Download data | |
run: | | |
# Download the external psp data | |
python -m sparc.download_data | |
# Check if psp8 exists | |
ls sparc/psp/*.psp8 | |
- name: Build wheel | |
run: | | |
# Wheels are inside dist/ folder | |
python -m build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: dist/ | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') |