slides update #27
This file contains hidden or 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: PyPI publishing | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
pypi: | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
# build the calculate-liam package and store outputs in dist folder | |
- run: pipx run build calculate-liam -o dist | |
# check the files in dist are valid | |
- run: pipx run twine check dist/* | |
# if this commit is tagged, upload the release to (test)PyPI | |
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
# to publish to the real PyPI remove this repository-url line: | |
repository-url: https://test.pypi.org/legacy/ | |
verbose: true | |
test: | |
runs-on: ${{ matrix.os }} | |
name: "${{ matrix.os }} :: ${{ matrix.python-version }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
python-version: ["3.8", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
# install the calculate-liam package including the optional test dependencies | |
- run: pip install -e .[test] | |
working-directory: calculate-liam | |
# run the test suite | |
- run: pytest -v | |
working-directory: calculate-liam/test |