Skip to content

Improve readability by packing frequently used variables into namedtuples. #414

Improve readability by packing frequently used variables into namedtuples.

Improve readability by packing frequently used variables into namedtuples. #414

Workflow file for this run

name: PyPI
on:
push:
branches:
- main
- auto-release
pull_request:
branches: [main]
release:
types: [published]
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
build:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Build the sdist and wheel
run: |
python -m pip install --upgrade pip build
python -m build
- name: Check the sdist installs and imports
run: |
python -m venv venv-sdist
# Since the whl distribution is build using sdist, it suffices
# to only test the wheel installation to ensure both function as expected.
venv-sdist/bin/python -m pip install dist/aehmc-*.whl
venv-sdist/bin/python -c "import aehmc;print(aehmc.__version__)"
- uses: actions/upload-artifact@v3
with:
name: artifact
path: dist
if-no-files-found: error
upload_pypi:
name: Upload to PyPI on release
needs: [build]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_secret }}