Skip to content

Backport PR #3257 on branch v4.0.x (Adding Rampviz logo from Jenn) #8091

Backport PR #3257 on branch v4.0.x (Adding Rampviz logo from Jenn)

Backport PR #3257 on branch v4.0.x (Adding Rampviz logo from Jenn) #8091

Workflow file for this run

name: Release
on:
# NOTE: PR trigger is to ensure changes do not break packaging.
pull_request:
release:
types: [released]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
if: github.repository == 'spacetelescope/jdaviz'
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: '3.10'
- name: Install python-build and twine
run: python -m pip install build "twine>=3.3" "importlib_metadata!=8.0.0"
- name: Build package
run: python -m build --sdist --wheel .
- name: List result
run: ls -l dist
- name: Check dist
run: python -m twine check --strict dist/*
- name: Test package
run: |
cd ..
python -m venv testenv
testenv/bin/pip install pytest pytest-astropy pytest-tornasync jdaviz/dist/*.whl
testenv/bin/python -c "import jdaviz; jdaviz.test(remote_data=True)"
# NOTE: Do not run this part for PR testing.
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3
if: github.event_name != 'pull_request'
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}