Skip to content

Update to Python ≥ 3.9 #8

Update to Python ≥ 3.9

Update to Python ≥ 3.9 #8

name: Build and publish to TestPyPI or PyPI
on: [push, pull_request]
jobs:
get_python_versions:
name: "Determine Python versions"
runs-on: ubuntu-latest
outputs:
min-python: ${{ steps.nep29.outputs.min-python }}
max-python: ${{ steps.nep29.outputs.max-python }}
steps:
- name: "calculate versions according to NEP29"
id: nep29
uses: mstimberg/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
build:
needs: [get_python_versions]
name: Build 🎡 and source 📦
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # we need the full history for the version calculation
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Build source tarball and noarch wheel
run: |
python -m pip install --upgrade pip build wheel
python -m build
- name: store distribution 📦
uses: actions/upload-artifact@v3
with:
name: packages
path: dist
deploy_dev:
name: Publish development 📦 to TestPyPI
runs-on: ubuntu-latest
if: github.repository == 'brian-team/brian2genn' && github.ref == 'refs/heads/master'
environment: development_release
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
needs:
- build
steps:
- name: load distribution 📦
uses: actions/download-artifact@v3
with:
name: packages
path: dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
deploy:
name: Publish release 📦 to PyPI
runs-on: ubuntu-latest
if: github.repository == 'brian-team/brian2genn' && startsWith(github.ref, 'refs/tags')
environment: release
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
needs:
- build
steps:
- name: load distribution 📦
uses: actions/download-artifact@v3
with:
name: packages
path: dist/
- name: Publish distribution release 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1